-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathemail.sh
More file actions
executable file
·25 lines (21 loc) · 819 Bytes
/
email.sh
File metadata and controls
executable file
·25 lines (21 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# Cannot create a new backup.
# A previous backup already exists in refs/original/
# Force overwriting the backup with -f
# 如果之前曾经执行过 git filter-branch 命令,在 refs/original/ 会有一个备份,这个时候需要删除备份,然后执行接下来的操作即可
git update-ref -d refs/original/refs/heads/master
git filter-branch --env-filter '
OLD_EMAIL="crabman@guoqiangdeMacBook-Pro-2.local"
CORRECT_NAME="CrabMen"
CORRECT_EMAIL="tobecrabman@163.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