3 # =============================================================================
4 # This is a modified version of this:
5 # https://help.github.com/articles/changing-author-info
6 # =============================================================================
9 FILTER_SCRIPT_TEMPLATE
='
10 an="$GIT_AUTHOR_NAME";
11 am="$GIT_AUTHOR_EMAIL";
12 cn="$GIT_COMMITTER_NAME";
13 cm="$GIT_COMMITTER_EMAIL";
15 if [ "$GIT_COMMITTER_EMAIL" = "OLD_COMMITTER_EMAIL" ];
17 cn="$GIT_COMMITTER_NAME";
18 cm="NEW_COMMITTER_EMAIL";
21 if [ "$GIT_AUTHOR_EMAIL" = "OLD_AUTHOR_EMAIL" ];
23 an="$GIT_AUTHOR_NAME";
24 am="NEW_AUTHOR_EMAIL";
27 export GIT_AUTHOR_NAME="$an";
28 export GIT_AUTHOR_EMAIL="$am";
29 export GIT_COMMITTER_NAME="$cn";
30 export GIT_COMMITTER_EMAIL="$cm";
35 git filter-branch
-f --env-filter "$1"
44 echo $FILTER_SCRIPT_TEMPLATE \
45 |
sed "s/OLD_COMMITTER_EMAIL/$old_email/g" \
46 |
sed "s/NEW_COMMITTER_EMAIL/$new_email/g" \
47 |
sed "s/OLD_AUTHOR_EMAIL/$old_email/g" \
48 |
sed "s/NEW_AUTHOR_EMAIL/$new_email/g" \
51 git_filter_branch
"$filter_script"
This page took 0.084042 seconds and 4 git commands to generate.