sliit-foss / gists

MIT License
3 stars 2 forks source link

Script to change author email of specific commits in a git repository #6

Open GIHAA opened 3 months ago

mrmihi commented 1 month ago

WRONG_EMAIL=${1:-"you_wrong_mail@hello.world"} NEW_NAME=${2:-"your name"} NEW_EMAIL=${3:-"new_mail@hello.world"}

git filter-branch -f --env-filter " 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;