Skip to content

Repeating the command gh issue develop twice breaks config #12575

Closed

Description

@bronius

Describe the bug

Issuing the command issue develop twice (once to create the remote branch, another time because I am a goofball) breaks local .git/config preventing any other git commands from succeeding until config is manually repaired.

Affected version

❯ gh --version
gh version 2.86.0 (2026-01-21)
https://github.com/cli/cli/releases/tag/v2.86.0

Steps to reproduce the behavior

  1. Type this gh issue develop 105 -bmain -nfeature/105-only-test-app-change-prs which creates the remote branch (and keeps you checked out in current branch)
  2. Repeat previous command: This attempts to recreate the branch but breaks config
  3. See error "fatal: bad config variable 'branch..gh-merge-base' in file '.git/config' at line"..

I got here by issuing gh issue develop ... like normal but realized I had neglected to also checkout the new branch. So I merely hit Up-arrow to repeat the command and added a -c flag to the previous command in hopes that gh cli would have noticed that the heavy lifting was already done and it merely needed to fetch and check out its branch.

Expected vs actual behavior

  • I expected that repeated gh issue develop would automatically detect having created a remote branch and attached to the issue and (with the newly added -c would have checked it out locally.
  • Instead, my .git/config file became corrupt with an entry like:
[branch ""]
	gh-merge-base = main

Workaround/fix: I manually edited and deleted those two lines (and manually fetched and checked out the new branch).

Logs

❯ gh issue develop 105 -bmain -nfeature/105-only-test-app-change-prs
github.com/MY_ORG/MY_REPO/feature/105-only-test-app-change-prs
From github.com:MY_ORG/aip-github-auth-app
 * [new branch]      feature/105-only-test-app-change-prs -> origin/feature/105-only-test-app-change-prs
❯ gh issue develop 105 -bmain -c -nfeature/105-only-test-app-change-prs
github.com/MY_ORG/MY_REPO/tree/
fatal: bad config variable 'branch..gh-merge-base' in file '.git/config' at line 89
failed to run git: exit status 128
❯ git fetch origin main:main
fatal: bad config variable 'branch..gh-merge-base' in file '.git/config' at line 89
❯ git pull
fatal: bad config variable 'branch..gh-merge-base' in file '.git/config' at line 89
❯ git st
On branch main
fatal: bad config variable 'branch..gh-merge-base' in file '.git/config' at line 89

Activity

  1. added
    priority-2Affects more than a few users but doesn't prevent core functions
    gh-issuerelating to the gh issue command
    and removed on Feb 6, 2026
  2. BagToad commented on Feb 6, 2026

    @BagToad
    Member

    Thanks for the report @bronius - adding the help wanted label if someone would like to investigate this and propose a fix.

  3. gunadhya commented on Feb 8, 2026

    @gunadhya
    Contributor

    Hi @BagToad is this issue up for grabs? I’d like to work on it

    Update: I've created a draft PR

  4. BagToad commented on Feb 9, 2026

    @BagToad
    Member

    @gunadhya Yes please do ❤️

  5. bronius commented on May 27, 2026

    @bronius
    Author

    Yippeee! Confirmed working in 2.96 (as of 2.88):

    ❯ gh issue develop 13 -bmain -nfeature/13-app-service-example
    Using existing linked branch "feature/13-app-service-example"
    

    Thank you 🙏

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

    bugSomething isn't workinggh-issuerelating to the gh issue commandhelp wantedContributions welcomepriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions