From f34fe6e86331e24cfe43ca242779887789c10559 Mon Sep 17 00:00:00 2001 From: Banana Date: Wed, 11 Nov 2015 12:03:01 +0100 Subject: [PATCH] git stuff. rewrite git author --- git/README | 1 + git/git-rewrite-author.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 git/README create mode 100755 git/git-rewrite-author.sh diff --git a/git/README b/git/README new file mode 100644 index 0000000..3d38c84 --- /dev/null +++ b/git/README @@ -0,0 +1 @@ +Stuff usefull while working with git. diff --git a/git/git-rewrite-author.sh b/git/git-rewrite-author.sh new file mode 100755 index 0000000..aef33cc --- /dev/null +++ b/git/git-rewrite-author.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# copywrite by Johannes 'Banana' Keßler 2015 + +git filter-branch --env-filter ' +OLD_EMAIL="OLD OR INVALID EMAIL" +CORRECT_NAME="NEW AUTHOR NAME" +CORRECT_EMAIL="NEW AUTHOR EMAIL" +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 -- 2.39.5