Skip to content

Instantly share code, notes, and snippets.

@zeroDivisible
Created September 25, 2014 20:09
Show Gist options
  • Save zeroDivisible/e8756f2eef898cdb6e96 to your computer and use it in GitHub Desktop.
Save zeroDivisible/e8756f2eef898cdb6e96 to your computer and use it in GitHub Desktop.
Local Checking out of pull requests.

Adding this snippet to your .git/config file:

[alias]
	giveme = "!sh -c 'git fetch origin refs/pull/$1/head && git checkout -b pull/$1 FETCH_HEAD' -"

allows you to run:

$ git giveme 1234

Which will fetch & checkout pull request 1234 locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment