Checkout github pull request branch
Here is quick zsh method to checkout a pull request by number
cd project
gcop 3
Add this to your zsh configs
gcop() {
git ls-remote --exit-code origin refs/pull/$1/merge
[ $? -ne 0 ] && echo "Could not find pull request $1" && return
git fetch origin +refs/pull/$1/merge
git checkout FETCH_HEAD
}
Written by Peter Baker
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#