Checkout directly on PR

· 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

Also, if you have the hub cli, you can do it directly with:

hub pr checkout 134

and commit and push directly you're change to the PR with

hub push


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 👇

70 people are talking about this


See more on github documentation.

You can find this page with theses search keywords:

/ pull / request /
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.