Skip to content

Instantly share code, notes, and snippets.

@gasolin
Created April 14, 2020 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gasolin/4f2555f5a241630365896bb26a8f1f5b to your computer and use it in GitHub Desktop.
Save gasolin/4f2555f5a241630365896bb26a8f1f5b to your computer and use it in GitHub Desktop.
script to fetch the PR and switched to the right branch
#Create a bash in your ~/.bash_profile
# Do `source ~/.bash_profile` or reopen the console to make it work.
# Call `pr 1234` (1234 is the pull request number)
# the PR will be fetched and switched to the right branch
pr() {
git fetch upstream pull/$1/head:pr-$1
git checkout pr-$1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment