Skip to content

gh issue develop creates branch on upstream repo instead of the fork #12986

Open

Description

@standard-librarian

not sure if this is a misunderstanding on my end or an actual issue but here's what happened

i have a fork of a repo, the standard setup where origin points to my fork and upstream to the original. ran gh issue develop <number> to start working on an issue and it created the branch on the upstream repo, not on my fork.

for contributors using the fork workflow this is pretty confusing because the whole point of having origin/upstream convention is to keep your work on your fork until you open a PR. creating the branch on upstream defeats that.

would it make sense to have gh issue develop check if the current repo is a fork and default to creating the branch on the fork instead? or at least a flag like --fork to explicitly target it?

Activity

  1. standard-librarian commented on Mar 21, 2026

    @standard-librarian
    Author

    i'd like to work on this if it turns out to be a valid issue

  2. BagToad commented on Mar 30, 2026

    @BagToad
    Member

    Hey @standard-librarian, could you check what your default repo is in this case please?

    gh repo set-default -v 
    

    Wondering if this setting is being respected for you here?

  3. added
    enhancement
    more-info-needed
    gh-issue
    on Mar 30, 2026
  4. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Contributions welcome label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

  5. removed
    needs-triage
    on Mar 30, 2026
  6. standard-librarian commented on Apr 1, 2026

    @standard-librarian
    Author

    I reproduced this in a fresh fork-style clone to double-check.

    In a clone where origin was standard-librarian/libsql and upstream was tursodatabase/libsql, gh repo set-default -v returned:

    tursodatabase/libsql
    

    Then I ran:

    GH_DEBUG=api gh issue develop 2217 --name codex-issue-develop-repro-20260401-1775028472 --base main

    The debug output showed gh resolving the issue as owner=tursodatabase repo=libsql, and the CreateLinkedBranch mutation also targeted the upstream repository. It failed with:

    GraphQL: standard-librarian does not have the correct permissions to execute `CreateLinkedBranch` (createLinkedBranch)
    

    So this does seem to confirm the behavior I reported: in a fork workflow, gh issue develop is targeting upstream for branch creation rather than the fork.

  7. removed
    more-info-needed
    on Apr 1, 2026
  8. kilasuit commented on Jul 15, 2026

    @kilasuit

    Without much digging, this looks to be default, I believe as the process flow here is mainly for those that are maintainer/contributors with write access to an upstream repo

    However, gh issue develop has --branch-repo which from the help mentions

      # Create a branch in repo monalisa/cli for issue 123 in repo cli/cli
      $ gh issue develop 123 --repo cli/cli --branch-repo monalisa/cli
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgh-issuestale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions