Skip to content

Instantly share code, notes, and snippets.

@cooperka
Created July 19, 2017 15:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cooperka/c4e08cca33dbcacbb421a61c2df571a2 to your computer and use it in GitHub Desktop.
Save cooperka/c4e08cca33dbcacbb421a61c2df571a2 to your computer and use it in GitHub Desktop.
A one-time setup to fetch code directly from GitHub PRs, so you don't need to download their fork or figure out their branch name.
# One-time setup
git config --global --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" # This is the important one
# Make sure there aren't duplicate configs
git config --global --list
# Checkout someone else's PR!
git fetch origin
git checkout pr/20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment