Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4- creates local branchpr/4from the githubupstream(if it exists) ororiginremote and checks it outgit pr 4 someremote- creates local branchpr/4fromsomeremoteremote and checks it outgit pr-clean- removes all pr/* branches from your local repogit spr- Same asgit prcommand, but for bitbucket/stash remotes
There is a better way to write
git pr-clean:I can also offer an
overengineeredimproved version ofgit prwith better logic for remote name autodetection (useful for me because I hate when my tools don't handle corner cases well) and incorporating @kwk's suggestion:(src: https://github.com/intelfx/dotfiles/blob/4dcc85171ae91d23f704d0ac7acdecaeed536cc6/.gitconfig#L73-L125)