Skip to content

Instantly share code, notes, and snippets.

@superdump
Created March 27, 2015 09:43
Show Gist options
  • Save superdump/3e3ba9c566bda4046813 to your computer and use it in GitHub Desktop.
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.
# 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