Created
January 21, 2019 17:03
-
-
Save switowski/8fdb9a1afef4e02e1ae7198088ab197d to your computer and use it in GitHub Desktop.
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
mpr = "!f() { \ | |
declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \ | |
declare branch=\"${2:-$currentBranch}\"; \ | |
if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \ | |
git fetch origin refs/pull/$1/head:pr/$1 && \ | |
git checkout -B $branch && \ | |
git rebase $branch pr/$1 && \ | |
git checkout -B $branch && \ | |
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