Created
August 28, 2017 14:05
-
-
Save auxiliary/2fa3c7b3ea3cc22108c6c065dce957ff to your computer and use it in GitHub Desktop.
Git change commit alias
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
[alias] | |
change-commits = "!f() { VAR1=$1; VAR='$'$1; OLD=$2; NEW=$3; echo \"Are you sure for replace $VAR $OLD => $NEW ?(Y/N)\";read OK;if [ \"$OK\" = 'Y' ] ; then shift 3; git filter-branch --env-filter \"if [ \\\"${VAR}\\\" = '$OLD' ]; then export $VAR1='$NEW';echo 'to $NEW'; fi\" $@; fi;}; f " | |
# Usage: | |
# git change-commits GIT_AUTHOR_EMAIL "OLD EMAIL" "NEW EMAIL" | |
# git push --force --tags origin 'refs/heads/*' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment