This repository has been archived by the owner on Dec 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
How do I `git checkout` a pull request?
Nathaniel Nutter edited this page Apr 1, 2015
·
3 revisions
You can checkout a single pull request reference by doing,
# replace $PR with the pull request number
git fetch origin +refs/pull/$PR/merge
git checkout FETCH_HEAD
If you want to fetch them all,
git fetch origin +refs/pull/*/merge:refs/remotes/origin/pr/*
For which you can then checkout the pull request by doing,
# replace $PR with the pull request number
git checkout origin/pr/$PR
If you want to automatically fetch pull requests you can add it to your repo's config,
git config --add remote.origin.fetch +refs/pull/*/merge:refs/remotes/origin/pr/*/merge
git fetch
Navigation
Home
Code Review Guidelines
How do I...
Github's "Fork a Repo"
GitHub's Help
Top Questions
How do I install 'hub'?
How do I fork a repository?
How do I make a pull request?
How do I review a pull request?
How do I know my pull request will be (or has been) reviewed?
How do I fix my pull request if it cannot be automatically merged?
How do I cleanup my feature branch once it has been merged?
How can I customize notifications?
How do I git checkout
a pull request?