Skip to content

Instantly share code, notes, and snippets.

@jeresig
Created October 1, 2009 22:49
Show Gist options
  • Save jeresig/199298 to your computer and use it in GitHub Desktop.
Save jeresig/199298 to your computer and use it in GitHub Desktop.
# Rename 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" = "[email protected]" ];
then
GIT_AUTHOR_EMAIL="[email protected]";
GIT_COMMITTER_EMAIL="[email protected]";
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