Skip to content

Instantly share code, notes, and snippets.

@peregrinogris
Created December 26, 2017 16:02
Show Gist options
  • Save peregrinogris/90bc45b77d7ae27668e2d2162f8d4f1a to your computer and use it in GitHub Desktop.
Save peregrinogris/90bc45b77d7ae27668e2d2162f8d4f1a to your computer and use it in GitHub Desktop.
# 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" = "<INITIAL-EMAIL>" ];
then
GIT_AUTHOR_EMAIL="<FINAL-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