Skip to content

Instantly share code, notes, and snippets.

@pietrop
Created January 27, 2020 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pietrop/d4100c05e695b421fcf48a2c17a51a7b to your computer and use it in GitHub Desktop.
Save pietrop/d4100c05e695b421fcf48a2c17a51a7b to your computer and use it in GitHub Desktop.
To checkout a PR from another repo. Eg you fork a repo you don’t own, or are not a member of. Someone else makes a PR to the original repo and you want to evaluate it locally in your fork.

To checkout a PR from another repo. Eg you fork a repo you don’t own, or are not a member of. Someone else makes a PR to the original repo and you want to evaluate it locally in your fork.

Add a remote upstream repository

git remote add UPSTREAM git@github.com/USERNAME:REPONAME

Check that it has been added - optional

git remote -v

Fetch all the branches from that repository

git fetch UPSTREAM

Will list all the available branches

Checkout the one you want to evaluate into its own branch locally

git checkout -b UPSTREAM/BRANCHNAME

Originally from stackoverflow


Example

git remote add upstream git@github.com/bbc:react-transcript-editor
git remote -v
git fetch upstream
git checkout -b upstream/timed-text-editor-fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment