Skip to content

Instantly share code, notes, and snippets.

@mohanarpit
Created December 6, 2012 11:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohanarpit/4223818 to your computer and use it in GitHub Desktop.
Save mohanarpit/4223818 to your computer and use it in GitHub Desktop.
Script to modify the author and commiter name & e-mail ID in the GIT tree
#!/bin/sh
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "<Old commit name>" ];
then
GIT_COMMITTER_NAME= "<New commit name>";
GIT_AUTHOR_NAME="<New author name>";
GIT_COMMITTER_EMAIL="<New commit email>";
GIT_AUTHOR_EMAIL="<New author 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