git filter-branch --env-filter ' declare -a OLD_EMAILS OLD_EMAILS=('babailong@126.com' 'Eric@Eric-PC' 'Eric@192.168.3.9') CORRECT_NAME="Eric Zong" CORRECT_EMAIL="ericzonglu@126.com" for item in ${OLD_EMAILS[@]};do if [ "$GIT_COMMITTER_EMAIL" = "$item" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$item" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_COMMITTER_EMAIL" = "$CORRECT_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" fi if [ "$GIT_AUTHOR_EMAIL" = "$CORRECT_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" fi done ' --tag-name-filter cat -- --branches --tags