Description
Describe the bug
When --name is a branch that already exists on the remote, gh issue develop fails with:
failed to create linked branch: API returned empty branch name
The message points at the API response, not the cause. The underlying createLinkedBranch mutation returns HTTP 200 with {"data":{"createLinkedBranch":{"linkedBranch":null}}} and no errors, and nothing is linked or created.
This is likely the real cause behind #13805, which was closed without a reproduction: that report blamed the slash in the branch name, but the test below shows an existing branch fails with or without a slash, and a new branch with a slash works.
Affected version
gh version 2.92.0 (2026-04-28), Linux
Steps to reproduce the behavior
- In any repository, push two branches:
exampleandfeat/example. - Open an issue.
- Run
gh issue develop <issue> --repo <owner>/<repo> --name example --base example. - See
failed to create linked branch: API returned empty branch name.gh issue develop --list <issue>shows nothing linked. - Repeat with
--name feat/example --base feat/example: same error. - Run
gh issue develop <issue> --repo <owner>/<repo> --name feat/new-example --base main: the branch is created and linked.
Tested
Private repository, gh 2.92.0, every branch pointing at the same main commit:
Branch passed to --name |
Already on remote? | Result |
|---|---|---|
example |
yes | API returned empty branch name, exit 1, nothing linked |
feat/example |
yes | API returned empty branch name, exit 1, nothing linked |
feat/new-example |
no | branch created and linked (--list shows it) |
Request ID of a failing mutation (from GH_DEBUG=api): DB0E:26CBEE:1EB28F1:2CA6176:6AEC648D
The third run was made outside a git checkout, so it also exited 1 with fatal: not in a git directory after creating the branch; that is #14856.
Expected vs actual behavior
Expected: before calling createLinkedBranch, check whether the branch already exists and say so, for example "branch example already exists; the API can only link a new branch. Link it from the issue's Development sidebar." Or check for a null linkedBranch and explain it.
Actual: a generic "empty branch name" error.
Additional context
The API side (no way to link an existing branch, and the silent null) is reported in https://github.com/orgs/community/discussions/212130.
Activity
cli-triage commentedon Nov 9, 2026
Partly reproduced on 2.92.0.
Using test data for the reported null mutation response:
Exit status:
1.The same command produced the same result on 2.103.3 and the selected source build. This confirms the CLI handles a null linked branch with the generic empty-name error. The test did not verify that an already-existing remote branch causes GitHub to return null. Using a new branch name remains the command-line workaround.
Supporting reports
Duplicate analysis
Label reasoning
Reproduction log
Investigation notes
Generated by issue triage.
ronin9110 commentedon Nov 11, 2026
To cover the server side the triage run couldn't check: calling the mutation directly against github.com, with the name and head
oidof a branch that already exists, returns HTTP 200 and{"data":{"createLinkedBranch":{"linkedBranch":null}}}with no
errors(request IDAB38:13AF3E:16BC662:2169649:6AEC3B6A). The same call with a new branch name creates and links the branch. So an existing branch name is what produces thenull.