Someone created a pull request on my Github repo. It mostly looks good, but I had to make a few minor changes to get it to pass my continuous integration server.
Github's on-screen instructions to "review" the request were to run:
git checkout -b otheruser-fix_somebug git pull https://github.com/otheruser/myrepo.git fix_somebug
I then made my changes, and committed locally. However, when I went to run git push
, git informed me:
fatal: The current branch otheruser-fix_somebug has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin otheruser-fix_somebug
which I did, but my changes are not showing under the pull request, but instead under a copy of the branch otheruser-fix_somebug
mirrored on my Github repo and unconnected to the pull request.
How should I have called git push
to get the changes to appear on the pull request?
Under your repository name, click Pull requests. In the "Pull Requests" list, click the pull request you'd like to modify. Next to the pull request's title, click Edit.
The current way to update a pull request is to click on the “Edit” button along the other pull request action buttons. This will bring you to the update pull request page where you can make changes to the title, description, reviewers and specify whether to close the branch after the pull request has been merged.
Open GitHub, switch to local repositories, double click repository. Switch the branch(near top of window) to the branch that you created the pull request from(i.e. the branch on your fork side of the compare) Should see option to enter commit comment on right and commit changes to your local repo.
To my knowledge, you can only do this if they grant you permission. In the past this was only possible by them adding you as a contributor on their fork, however, in September 2016, GitHub added a feature for exactly this use case, allowing the person requesting the Pull Request to give permission to the maintainer(s) of the upstream repository simply by marking a checkbox.
You can make a comment on the Pull Request, telling them that their are some issues you'd like to fix before merging the Pull Request, and stating that you'd like them to give you permission to commit to their Pull Request branch by checking the "Allow edits from maintainers" checkbox on the Pull Request, and giving them a link to the GitHub Help page about the feature, so they can see exactly how to enable it. Once they've done so, you can push to the Pull Request branch of their repository directly.
Things you can do if they haven't/won't give you write access to their pull request branch:
Make comments on their Pull Request:
Make comments on the code in their Pull Request:
Accept it as is, then fix it in your own repository
What about checking out the branch from the Pull Request? Then you can do the commit there, and push to that branch directly.
git fetch git checkout fix_somebug
add the commit with your changes
git push origin fix_somebug
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