Skip to content

Instantly share code, notes, and snippets.

@captainsafia
Last active March 16, 2017 16:55
Show Gist options
  • Select an option

  • Save captainsafia/954351fc7b05bb748b5d2112624f8a2f to your computer and use it in GitHub Desktop.

Select an option

Save captainsafia/954351fc7b05bb748b5d2112624f8a2f to your computer and use it in GitHub Desktop.
A fish function that allows you to quickly checkout a branch for a pull request on a repo
function gh-pull
git fetch $argv[1] pull/$argv[2]/head:pr-$argv[2]
git checkout pr-$argv[2]
end
captainsafia@eniac ~/p/goops> gh-pull origin 2
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 11 (delta 6), reused 11 (delta 6), pack-reused 0
Unpacking objects: 100% (11/11), done.
From https://github.com/captainsafia/goops
* [new ref] refs/pull/2/head -> pr-2
Switched to branch 'pr-2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment