Last active
March 10, 2018 14:12
-
-
Save lawvs/279d6983495989d4cb2cc34af1a51f05 to your computer and use it in GitHub Desktop.
Git核弹级操作
This file contains 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/sh | |
git filter-branch --commit-filter ' | |
OLD_EMAIL="your-old-email@example.com" | |
CORRECT_NAME="your-correct-name" | |
CORRECT_EMAIL="your-correct-email@example.com" | |
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]; | |
then | |
GIT_AUTHOR_NAME="$CORRECT_NAME"; | |
GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"; | |
GIT_COMMITTER_NAME="$CORRECT_NAME"; | |
GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; | |
fi' HEAD |
This file contains 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/sh | |
git filter-branch --tree-filter 'rm -f passwords.txt' HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment