git-reset-committer.sh
· 492 B · Bash
原始檔案
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
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
| 1 | #!/bin/sh |
| 2 | |
| 3 | git filter-branch --env-filter ' |
| 4 | OLD_EMAIL="[email protected]" |
| 5 | CORRECT_NAME="Your Correct Name" |
| 6 | CORRECT_EMAIL="[email protected]" |
| 7 | if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] |
| 8 | then |
| 9 | export GIT_COMMITTER_NAME="$CORRECT_NAME" |
| 10 | export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" |
| 11 | fi |
| 12 | if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] |
| 13 | then |
| 14 | export GIT_AUTHOR_NAME="$CORRECT_NAME" |
| 15 | export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" |
| 16 | fi |
| 17 | ' --tag-name-filter cat -- --branches --tags |