Skip to content

Instantly share code, notes, and snippets.

@mdeangelo272
Last active May 31, 2017 20:00
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 mdeangelo272/77f8ec83cb12e6ea3796d708b04e4e62 to your computer and use it in GitHub Desktop.
Save mdeangelo272/77f8ec83cb12e6ea3796d708b04e4e62 to your computer and use it in GitHub Desktop.
Git Git User Configurations
#!/usr/bin/env sh
# Note: You should also update the [user] group in .git/config
# Note: This does not play nicely with remotes. You will need to blow them away and start over :(
# ref: https://stackoverflow.com/questions/750172/change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-git
git filter-branch --env-filter '
OLD_EMAIL="iam@mdeangelo272.me"
CORRECT_NAME="Michael DeAngelo"
CORRECT_EMAIL="mdeangelo@trace3.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_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