Created
March 27, 2015 09:43
-
-
Save superdump/3e3ba9c566bda4046813 to your computer and use it in GitHub Desktop.
Rebase PR on top of master and merge --ff-only. a.k.a. No GitHub, I do not want unreadable git history due to merges.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Merge GitHub pull request on top of the `master` branch | |
mpr = "!f() { \ | |
if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \ | |
git fetch origin refs/pull/$1/head:pr/$1 && \ | |
git rebase master pr/$1 && \ | |
git checkout master && \ | |
git merge --ff-only pr/$1 && \ | |
git branch -D pr/$1; \ | |
fi \ | |
}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment