Skip to content

Instantly share code, notes, and snippets.

@joallard
Created April 14, 2013 22:52
Show Gist options
  • Save joallard/5384568 to your computer and use it in GitHub Desktop.
Save joallard/5384568 to your computer and use it in GitHub Desktop.
Git Rename Author
#!/bin/sh
OLD_NAME="old"
NEW_NAME="New Oldman"
NEW_EMAIL="new.oldman@mail"
git filter-branch -f --commit-filter "
if [ \"\$GIT_COMMITTER_NAME\" = \"$OLD_NAME\" ];
then
GIT_COMMITTER_NAME=\"$NEW_NAME\";
GIT_AUTHOR_NAME=\"$NEW_NAME\";
GIT_COMMITTER_EMAIL=\"$NEW_EMAIL\";
GIT_AUTHOR_EMAIL=\"$NEW_EMAIL\";
git commit-tree \"\$@\";
else
git commit-tree \"\$@\";
fi" HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment