Skip to content

Instantly share code, notes, and snippets.

@peregrinogris
Created June 11, 2011 04:17
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 peregrinogris/faf88d2c1dadc549380f to your computer and use it in GitHub Desktop.
Save peregrinogris/faf88d2c1dadc549380f to your computer and use it in GitHub Desktop.
Change Committer Email on a git repository
# name an email address in all old commits.
# WARNING: Will change all your commit SHA1s.
# Based off of the script from here:
# http://coffee.geek.nz/how-change-author-git.html
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "<OLDMAIL>" ];
then
GIT_AUTHOR_EMAIL="<NEWMAIL>";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment