Created
March 22, 2020 06:50
-
-
Save takehaya/6105d3a01f7fa141a0d4d47c0e2a8b7b to your computer and use it in GitHub Desktop.
Shell script to change at once when developing with git with wrong address and name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/zsh | |
| git filter-branch -f --env-filter ' | |
| OLD_EMAIL="" | |
| CORRECT_NAME="takehaya" | |
| 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 | |
| ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment