Skip to content

Instantly share code, notes, and snippets.

@debo
Last active June 11, 2019 15:41
Show Gist options
  • Save debo/218b03622554a8c9e18e384cb5e5a911 to your computer and use it in GitHub Desktop.
Save debo/218b03622554a8c9e18e384cb5e5a911 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
git filter-branch --env-filter '
old_author_email="$1"
new_author_name="$2"
new_author_email="$3"
if [ "$GIT_COMMITTER_EMAIL" = "$old_author_email" ]
then
export GIT_COMMITTER_NAME="$new_author_name"
export GIT_COMMITTER_EMAIL="$new_author_email"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$old_author_email" ]
then
export GIT_AUTHOR_NAME="$new_author_name"
export GIT_AUTHOR_EMAIL="$new_author_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