Skip to content

Instantly share code, notes, and snippets.

@qwersk
Created September 25, 2018 08:59
Show Gist options
  • Save qwersk/02e62e3320d9eff861b8ad98115aaf51 to your computer and use it in GitHub Desktop.
Save qwersk/02e62e3320d9eff861b8ad98115aaf51 to your computer and use it in GitHub Desktop.
Change all commits author's name and email #GIT
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="OLD_EMAIL"
CORRECT_NAME="NEW_NAME"
CORRECT_EMAIL="NEW_EMAIL"
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 > log.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment