Repository navigation
Repeating the command gh issue develop twice breaks config #12575
Description
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
- Type this
gh issue develop 105 -bmain -nfeature/105-only-test-app-change-prswhich creates the remote branch (and keeps you checked out in current branch) - Repeat previous command: This attempts to recreate the branch but breaks config
- 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 developwould automatically detect having created a remote branch and attached to the issue and (with the newly added-cwould have checked it out locally. - Instead, my
.git/configfile 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
BagToad commentedon Feb 6, 2026
Thanks for the report @bronius - adding the help wanted label if someone would like to investigate this and propose a fix.
gunadhya commentedon Feb 8, 2026
Hi @BagToad is this issue up for grabs? I’d like to work on it
Update: I've created a draft PR
BagToad commentedon Feb 9, 2026
@gunadhya Yes please do ❤️
bronius commentedon May 27, 2026
Yippeee! Confirmed working in 2.96 (as of 2.88):
Thank you 🙏