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
Describe the feature or problem you’d like to solve
Doing gh pr create on a branch that's pushed to a fork doesn't detect the branch properly. Running the same command before pushing allows you to choose the remote and then correctly detects it when creating the PR.
Proposed solution
How will it benefit CLI and its users? A lot of people push branches to their forks not to the main repo!
Additional context
Without pushing first
`
gh pr create
Warning: 4 uncommitted changes
? Where should we push the 'tests' branch? maram/testRepo
Creating pull request for tests into master in ORG/testRepo
? Title tests
? Body
? What's next? Continue in browser
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 12 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 730 bytes | 730.00 KiB/s, done.
Total 8 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), completed with 5 local objects.
To https:///maram/testRepo.git 2f524a467..9e1b2d88a HEAD -> tests
Branch 'tests' set up to track remote branch 'tests' from 'origin'.
Opening /ORG/testRepo/compare/master...maram:tests in your browser.`. <<< correctly detects my fork!!
With pushing first
`
gh pr create
Creating pull request for tests into master in ORG/testRepo
? Title tests
? Body
? What's next? Continue in browser
Opening /ORG/testRepo/compare/master...tests in your browser.`
This just caused me a lot of pain. I meticulously created a pull request and when I wanted to submit it, I just got:
pull request create failed: GraphQL error: Head sha can't be blank, Base sha can't be blank, No commits between master and ts-enum-type, Head ref must be a branch
@mislav There seems to be a regression in the latest release (1.3.0 (2020-11-24)). PR creations using forks seem to be chopping off the fork name from the url.
Even running in interactive mode, I get the same result:
$ gh pr create
Creating pull request for wandergeek:branch into master in org/repo
? Title my cool title
? Body <Received>
? What's next? Continue in browser
Opening github.com/elastic/cloud/compare/master...branch in your browser.
Activity
bodograumann commentedon Sep 28, 2020
This just caused me a lot of pain. I meticulously created a pull request and when I wanted to submit it, I just got:
Now my PR text is gone 😢
wandergeek commentedon Nov 26, 2020
@mislav There seems to be a regression in the latest release
(1.3.0 (2020-11-24)). PR creations using forks seem to be chopping off the fork name from the url.For example, the tool visits https://github.com/org/repo/compare/master...branch instead of https://github.com/org/repo/compare/master...wandergeek:branch
Even running in interactive mode, I get the same result:
mislav commentedon Dec 1, 2020
@wandergeek You're right, there is a regression. Thank you for letting us know! We have a fix under way.