Created
July 16, 2012 08:16
-
-
Save wolfc/3121492 to your computer and use it in GitHub Desktop.
Rename an email address on the current branch
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
#!/bin/sh | |
if [ $# != 2 ]; then | |
echo 1>&2 "Usage: $0 <old-email> <new-email>" | |
exit 1 | |
fi | |
export OLD_EMAIL="$1" | |
export NEW_EMAIL="$2" | |
git filter-branch -f --env-filter \ | |
'if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]; then | |
export GIT_AUTHOR_EMAIL="$NEW_EMAIL"; fi | |
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]; then | |
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"; fi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment