From dbf0b7ebf4fbc072fae19c6731c3f618f8ed8770 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Wed, 23 May 2012 11:38:56 +0200 Subject: .gitconfig: Add `credit` alias to quickly change the author of the latest commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inspired by @holman’s https://github.com/holman/dotfiles/blob/master/bin/git-credit. --- .gitconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to '.gitconfig') 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 -- cgit v1.2.3