Merge a remote pull to the current branch
Add the following script to
~/.gitconfig1
2[alias]
pr = "!f() { git fetch ${2:-upstream} pull/$1/head:pr/$1 && git checkout pr/$1; }; f"Use
git pr PULL_NUMto download the pull, for example, usegit pr 577to checkout pr 577 into a branch calledpr/577Merge the above branch to the target branch, for example
git merge pr/577
Rebase
1 | git pull --rebase upstream master |
Change branch to master
1 | git branch -m old-name new-name |