Skip to content

Commit

Permalink
.gitconfig: Add alias to merge GitHub pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
alrra authored and mathiasbynens committed Sep 20, 2014
1 parent f89753e commit ab9c178
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@
# List contributors with number of commits
contributors = shortlog --summary --numbered

# 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 pr/$1 && \
git branch -D pr/$1 && \
git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
fi \
}; f"
[apply]
# Detect whitespace errors when applying a patch
Expand Down

0 comments on commit ab9c178

Please sign in to comment.