Skip to content

Instantly share code, notes, and snippets.

@ezmiller
Created October 2, 2019 10:24
Show Gist options
  • Save ezmiller/968c1ff9279b9ca1a895e5517877cbf3 to your computer and use it in GitHub Desktop.
Save ezmiller/968c1ff9279b9ca1a895e5517877cbf3 to your computer and use it in GitHub Desktop.
Checking out a branch from a fork
# See here: https://git.521000.bestmunity/t5/How-to-use-Git-and-GitHub/Checkout-a-branch-from-a-fork/td-p/77
git ls-remote --refs origin -- will list refs for remote `origin`, some will look like `refs/pull/<some-num>/head`
git fetch origin pull/123/head:pr/123 && git checkout pr/123 # fetch and checkout PR #123, eg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment