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-prs which 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 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
Describe the bug
Issuing the command
issue developtwice (once to create the remote branch, another time because I am a goofball) breaks local.git/configpreventing 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
gh issue develop 105 -bmain -nfeature/105-only-test-app-change-prswhich creates the remote branch (and keeps you checked out in current branch)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-cflag 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
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..git/configfile became corrupt with an entry like:Workaround/fix: I manually edited and deleted those two lines (and manually fetched and checked out the new branch).
Logs