Created
October 9, 2009 07:28
-
-
Save kogakure/205825 to your computer and use it in GitHub Desktop.
Bash: Git – Rename an email address in all old commits.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" = "joern.zaefferer@googlemail.com" ]; | |
then | |
GIT_AUTHOR_EMAIL="joern.zaefferer@gmail.com"; | |
GIT_COMMITTER_EMAIL="joern.zaefferer@gmail.com"; | |
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
Doesn't work. Deletes all commits.
That
git push --force
is a terrible idea to put into an automatic script that can delete all your commits