Skip to content

Instantly share code, notes, and snippets.

@harish86
Created May 18, 2013 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harish86/5605415 to your computer and use it in GitHub Desktop.
Save harish86/5605415 to your computer and use it in GitHub Desktop.
Git: Changing author name or email for old commits in a git repo. Extracted from: http://stackoverflow.com/questions/750172/how-do-i-change-the-author-of-a-commit-in-git
git filter-branch --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