From 5c37849ce86bee660b2f7e9c1aaf7d3969e4fa0a Mon Sep 17 00:00:00 2001 From: ston1th Date: Mon, 21 Sep 2015 22:59:09 +0200 Subject: [PATCH] added git-commit-rewrite.sh --- git-commit-rewrite.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 git-commit-rewrite.sh diff --git a/git-commit-rewrite.sh b/git-commit-rewrite.sh new file mode 100755 index 0000000..7e890d0 --- /dev/null +++ b/git-commit-rewrite.sh @@ -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