Checkout directly on PR

3/28/2019
· 1 min read

A tiny function to checkout directly on PR:

function copr {
  git fetch origin pull/$1/head:pr-$1
  git checkout pr-$1
} 

copr 134

from:

You can checkout someone's PR in Git using the following:

git fetch origin pull/{PR id}/head:pr-{PR id}
git checkout pr-{PR id}

If you know an easier way, feel free to leave it down below 👇

75 people are talking about this

See more on github documentation.

You can find this page with theses search keywords:

/ pull / request /
Mathieu TUDISCO
Thanks for reading!
I'm Mathieu TUDISCO, a lead developer at Linkvalue .
You can find me anywhere with @mathieutu.
As a start you can follow me on Twitter or want to find out more about me or the blog .