I have been having trouble grabbing a pull request. Here is my command line attempt at the pull request code:
$ git fetch upstream pull/3/head:testbranch
Password for 'http://[email protected]':
fatal: Couldn't find remote ref pull/3/head
Unexpected end of command stream
We are using an origin repo and an upstream repo.
Pull requests go to upstream and origin is just under my name, I would like to pull down a request (#3) for review. However any time I try to grab a pull it gives me the same error even if I change from upstream to origin.
What would be causing this issue? After I grab the code I would like to put it in a branch and basically take over work on it (a hand off) so I don't need access to the person's repo that made the pull request, just the content, and I am set up as an approver for the pull request itself already
Restoring a deleted branchUnder your repository name, click Pull requests. Click Closed to see a list of closed pull requests. In the list of pull requests, click the pull request that's associated with the branch that you want to restore. Near the bottom of the pull request, click Restore branch.
On GitHub.com, navigate to the main page of the repository. In the "Branch" menu, choose the branch that contains your commits. Above the list of files, click Pull request.
Looking at the output it seems that either the PR is closed or the PR does not exist.
NOTE: Please commit your code before doing this as if you might have updated the code which will not be present anywhere then you might be in trouble.
The ideal way to test a PR is this way:
git fetch upstream pull/{PR-NUMBER}/head:test-branch-name
git checkout master
git merge test-branch-name
NOTE: If you find out that the code was bad and want to trace back to the previous commit then use this command:
git reset --hard HEAD@{1}
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With