Add a new script to rename the commit username of a git repo.

This commit is contained in:
Jeremy Gardais 2014-12-09 14:03:22 +01:00
parent cb520c65ef
commit 596fdf9f85
1 changed files with 13 additions and 0 deletions

13
changeuser.sh Executable file
View File

@ -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