From 596fdf9f858948cf1967cfb0628f05de968ecde1 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 9 Dec 2014 14:03:22 +0100 Subject: [PATCH] Add a new script to rename the commit username of a git repo. --- changeuser.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 changeuser.sh diff --git a/changeuser.sh b/changeuser.sh new file mode 100755 index 0000000..adacdf8 --- /dev/null +++ b/changeuser.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +git filter-branch --commit-filter ' +if [ "$GIT_COMMITTER_NAME" = "OLD_USERNAME" ]; +then + GIT_COMMITTER_NAME="NEW_USERNAME"; + GIT_AUTHOR_NAME="NEW_USERNAME"; + GIT_COMMITTER_EMAIL="EMAIL_NEW_USERNAME"; + GIT_AUTHOR_EMAIL="EMAIL_NEW_USERNAME"; + git commit-tree "$@"; +else + git commit-tree "$@"; +fi' HEAD