Assume userfoo has sent us a pull request. We want to test their changes locally and possibly make some edits before merging the pull request into our repository.
Create a new temporary branch based on
masterto test the changes.
git checkout -b <temp-branch-name> master
Download the pull request. We need the url and branch name; we can get these from the GitHub pull request page by clicking the
command line instructionslink.
git pull https://github.com/userfoo/project.git branch-name
- We can now review, test, and edit the changes locally. To merge the edited pull request, first commit our edits to the temporary branch, then:
git checkout master git merge --no-ff <temp-branch-name> git push origin master
- We can now delete the temporary branch:
git branch -d <temp-branch-name>