This file contains hidden or 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
#!/bin/bash | |
OLD_EMAIL="[email protected]" | |
NEW_EMAIL="[email protected]" | |
# Verify that the old email exists in the commit history | |
if git log --all --grep="$OLD_EMAIL" --author="$OLD_EMAIL" --oneline --quiet; then | |
# Rewrite the Git history | |
git filter-branch --env-filter " | |
if [ \"\$GIT_AUTHOR_EMAIL\" = \"$OLD_EMAIL\" ]; then |
OlderNewer