Last active
January 30, 2023 00:56
-
-
Save bryanbraun/f06a5b91791c4e9c8574 to your computer and use it in GitHub Desktop.
Checkout Github Pull Requests locally without adding remotes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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