summaryrefslogtreecommitdiff
path: root/git-author-rewrite.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-author-rewrite.sh')
-rw-r--r--git-author-rewrite.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/git-author-rewrite.sh b/git-author-rewrite.sh
new file mode 100644
index 0000000..39513e4
--- /dev/null
+++ b/git-author-rewrite.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+git filter-branch --env-filter '
+#OLD_EMAIL="vasudeva.kamath@in.abb.com"
+#CORRECT_NAME="Your Correct Name"
+#CORRECT_EMAIL="your-correct-email@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