added git-commit-rewrite.sh
This commit is contained in:
parent
601728bd75
commit
5c37849ce8
1 changed files with 15 additions and 0 deletions
15
git-commit-rewrite.sh
Executable file
15
git-commit-rewrite.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
git filter-branch --env-filter '
|
||||||
|
OLD_EMAIL="old@example.com"
|
||||||
|
CORRECT_NAME="name"
|
||||||
|
CORRECT_EMAIL="name@example.com"
|
||||||
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue