Skip to content

Instantly share code, notes, and snippets.

@calevano
Last active May 8, 2017 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calevano/3e4f5880d0e1a1422909aa1689a9086c to your computer and use it in GitHub Desktop.
Save calevano/3e4f5880d0e1a1422909aa1689a9086c to your computer and use it in GitHub Desktop.
Git - Change email
git filter-branch --env-filter '
WRONG_EMAIL="dude@gmail.com"
NEW_NAME="Dude Name"
NEW_EMAIL="dude@company.com"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_AUTHOR_NAME="$NEW_NAME"
export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment