Skip to content

Instantly share code, notes, and snippets.

@shrop
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save shrop/85eb7f6d454c819879c0 to your computer and use it in GitHub Desktop.

Select an option

Save shrop/85eb7f6d454c819879c0 to your computer and use it in GitHub Desktop.
Git Alias Setup for Checking Out Pull Requests from Stash and Github
[alias]
# Checkout Stash pull requests.
spr = !sh -c \"git fetch origin pull-requests/${1}/from:pr/${1}/from && git fetch origin pull-requests/${1}/merge:pr/${1}/merge && git checkout pr/${1}/from\" -
# Checkout Github pull requests.
gpr = !sh -c \"git fetch origin pull/${1}/head:pr/${1} && git checkout pr/${1}\" -
$ git spr <pr-number>
$ git gpr <pr-number>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment