You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Sometimes I remove email addresses from my GitHub profile. This makes the contributions in my profile disappear as the email address is no longer associated with my account. This script replaces commits with input email with current git config.
6
+
7
+
if [ -z"$1" ];then
8
+
echo"Error: old_email argument is required."
9
+
exit 1
10
+
fi
11
+
12
+
old_email="$1"
13
+
new_email="$(git config user.email)"
14
+
new_name="$(git config user.name)"
15
+
16
+
# Replacing author and committer emails has to be done separately to avoid unintentional overwrites
17
+
# e.g. in commits with multiple authors.
18
+
(export FILTER_BRANCH_SQUELCH_WARNING=1 && \
19
+
echo"1/2 Overwriting committer"&& \
20
+
git filter-branch -f --commit-filter "
21
+
if [ \"\$GIT_COMMITTER_EMAIL\" = \"$old_email\" ];
0 commit comments