Skip to content

Instantly share code, notes, and snippets.

@bryanbraun
Last active Mar 4, 2016
Embed
What would you like to do?
Checkout Github Pull Requests locally without adding remotes
# Edit the .git/config file in your local repo like so:
# cd <path/to/project>
# vim .git/config
# (include the lines below)
[remote "origin"]
url = https://github.com/bryanbraun/anchorjs.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/pull/*/head:refs/pull/origin/*
# Note: The last line is the new one. The other lines will already be present
# if you have defined a remote repository named "origin".
# Now to checkout a pull request locally (like PR #14), just run:
# git fetch origin
# git checkout -b branch-name refs/pull/origin/14
# For more information, see: https://help.github.com/articles/checking-out-pull-requests-locally/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment