Repository navigation
Description
Describe the bug
I have an automated workflow where my script pushes a local commit to a new branch in my fork, but it does not create any local branch for such a commit (which is done to keep local references clean).
In that scenario, I'm unable to use gh pr create with the --fill-first flag. I was trying something like below:
gh pr create --head <myuser>:<branch-name> --base <the-base> --R <the-original-repo> --fill-first
But that fails with the following message:
could not compute title or body defaults: failed to run git: fatal: ambiguous argument '<my-fork-remote>/<the-base>...<branch-name>': unknown revision or path not in the working tree.
Does the --fill-first option expect a local branch tracking the remote one to exist? If so, could that be fixed so that gh uses <my-fork-remote>/<branch-name> instead of the local branch in order to get the the title and body from the commit object?
Affected version
Please run gh version and paste the output below.
gh version 2.83.2 (2025-12-10)
https://github.com/cli/cli/releases/tag/v2.83.2
Steps to reproduce the behavior
- Push a commit to a new branch on your fork but don't have a local branch for it.
- Try to use
gh pr createwith--fill-firstas explained in the description. - See error.
Expected vs actual behavior
A clear and concise description of what you expected to happen and what actually happened.
Logs
Paste the activity from your command line. Redact if needed.
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2025-12-30 17:27:58.109539028 -0300 -03 m=+0.053550988
* Request to https://api.github.com/graphql
> POST /graphql HTTP/1.1
> Host: api.github.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: <redacted>
> Content-Length: 534
> Content-Type: application/json; charset=utf-8
> Graphql-Features: merge_queue
> Time-Zone: <redacted>
> User-Agent: GitHub CLI v2.83.2
GraphQL query:
fragment repo on Repository {
id
name
owner { login }
hasIssuesEnabled
description
hasWikiEnabled
viewerPermission
defaultBranchRef {
name
}
}
query RepositoryInfo($owner: String!, $name: String!) {
repository(owner: $owner, name: $name) {
...repo
parent {
...repo
}
mergeCommitAllowed
rebaseMergeAllowed
squashMergeAllowed
}
}
GraphQL variables: {"name":"<fork-repo-name>","owner":"<my-user>"}
< HTTP/2.0 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json; charset=utf-8
< Date: Tue, 30 Dec 2025 20:27:59 GMT
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: github.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Accepted-Oauth-Scopes: repo
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Media-Type: github.v4; param=merge-info-preview.nebula-preview; format=json
< X-Github-Request-Id: <redacted>
< X-Oauth-Client-Id: <redacted>
< X-Oauth-Scopes: gist, read:org, repo
< X-Ratelimit-Limit: 5000
< X-Ratelimit-Remaining: 4959
< X-Ratelimit-Reset: 1767127634
< X-Ratelimit-Resource: graphql
< X-Ratelimit-Used: 41
< X-Xss-Protection: 0
{
"data": {
"repository": {
"id": "<redacted>",
"name": "<fork-repo-name>",
"owner": {
"login": "<my-user>"
},
"hasIssuesEnabled": true,
"description": "<redacted>",
"hasWikiEnabled": true,
"viewerPermission": "ADMIN",
"defaultBranchRef": {
"name": "master"
},
"parent": {
"id": "<redacted>",
"name": "<fork-repo-name>",
"owner": {
"login": "<redacted>"
},
"hasIssuesEnabled": true,
"description": "<redacted>",
"hasWikiEnabled": true,
"viewerPermission": "WRITE",
"defaultBranchRef": {
"name": "master"
}
},
"mergeCommitAllowed": true,
"rebaseMergeAllowed": true,
"squashMergeAllowed": true
}
}
}
* Request took 1.583616141s
[git config --get-regexp ^branch\.<branch-name>\.(remote|merge|pushremote|gh-merge-base)$]
[git -c log.ShowSignature=false log --pretty=format:%H%x00%s%x00%b%x00 --cherry <my-fork-remote>/<the-base>...<branch-name>]
could not compute title or body defaults: failed to run git: fatal: ambiguous argument '<my-fork-remote>/<the-base>...<branch-name>': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Activity
github-actions commentedon Mar 16, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.