Yet another one DevOps blog

Ops and DevOps stories

Jan 25, 2014 - 1 minute read - Comments - technical git amazon ruby

Rewriting your email in git commits

Sometimes you need to rewrite your email in your commits in some git repository. Do it with command:

git filter-branch --env-filter 'if [ $GIT_AUTHOR_EMAIL = bad@email ]; then GIT_AUTHOR_EMAIL=correct@email; fi; export GIT_AUTHOR_EMAIL'

For your collaborators this operatioin might be dangerous. According to Jakub Narębski collaborators will need to:

  • if they didn’t base their work on history pre-rewrite, just git reset --hard origin/master or just git pull origin (which should fast-forward).
  • If they based their change, they have to rebase using git rebase origin/master or just git pull --rebase origin

More info: