You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh pr create --web fails if branch name contains a forward slash #10857
I have a branch created with a name of TICKET/test-name. In github-cli versions prior to 2.71.0, gh pr create --web worked successfully. As of 2.71.0, the command fails with an error:
➜ gh pr create --web
remote tracking branch must have format refs/remotes/<remote>/<branch> but was: refs/remotes/origin/TICKET/test-name
Affected version
Please run gh version and paste the output below.
➜ gh version
gh version 2.71.0 (2025-04-23)
Steps to reproduce the behavior
Create a branch with a name containing a forward slash.
Run gh pr create --web
See error
Expected vs actual behavior
I'd expect the PR to be created successfully.
Logs
➜ GH_DEBUG=true gh pr create --web
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2025-04-24 15:06:27.579786 +0900 JST m=+0.115545042
* Request to https://api.github.com/graphql
* Request took 749.412042ms
[git status --porcelain]
[git symbolic-ref --quiet HEAD]
[git config --get-regexp ^branch\.TICKET/test-name\.(remote|merge|pushremote|gh-merge-base)$]
[git rev-parse --symbolic-full-name TICKET/test-name@{push}]
[git config push.default]
[git config remote.pushDefault]
[git show-ref --verify -- HEAD refs/remotes/origin/TICKET/test-name]
remote tracking branch must have format refs/remotes/<remote>/<branch> but was: refs/remotes/origin/TICKET/test-name
Thanks @pdunnavant, we did a lot work around resolving the push target and I made a silly assumption when parsing remote refs. I think we'll do a new release asap.
Activity
williammartin commentedon Apr 24, 2025
Thanks @pdunnavant, we did a lot work around resolving the push target and I made a silly assumption when parsing remote refs. I think we'll do a new release asap.