aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2012-05-23 11:38:56 +0200
committerMathias Bynens <mathias@qiwi.be>2012-05-23 11:38:56 +0200
commitdbf0b7ebf4fbc072fae19c6731c3f618f8ed8770 (patch)
tree6993a35fccf57e499c9029f51c0d209ce2ccff1c
parent475039d0d665be2b386f3697f7456f72537f50d3 (diff)
downloaddotfiles-dbf0b7ebf4fbc072fae19c6731c3f618f8ed8770.tar.gz
dotfiles-dbf0b7ebf4fbc072fae19c6731c3f618f8ed8770.tar.bz2
dotfiles-dbf0b7ebf4fbc072fae19c6731c3f618f8ed8770.zip
.gitconfig: Add `credit` alias to quickly change the author of the latest commit
Inspired by @holman’s https://github.com/holman/dotfiles/blob/master/bin/git-credit.
-rw-r--r--.gitconfig2
1 files changed, 2 insertions, 0 deletions
diff --git a/.gitconfig b/.gitconfig
index 422e082..fdf1dcf 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -13,6 +13,8 @@
ca = !git add . && git add -u && git commit -a
# Switch to a branch, creating it if necessary
go = checkout -B
+ # Credit an author on the latest commit
+ credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
# Undo a `git push`
undopush = push -f origin HEAD^:master