参考解决方案:

https://help.github.com/en/articles/changing-author-info
https://blog.csdn.net/ouyang_peng/article/details/75329779

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

1.保证自己本地仓库和远程仓库同步
2.在本地项目下写一个脚本renamesh.sh

#!/bin/sh

git filter-branch --env-filter '

OLD_EMAIL="your-old-email@example.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


注意:OLD_EMAIL、CORRECT_NAME、CORRECT_EMAIL 需要修改

 

3.运行脚本
chmod +x renamesh.sh
./renamesh.sh

4.推送正确历史记录到github
git push --force --tags origin 'refs/heads/*'


说明:建议按照github的步骤进行,clone个库下来

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄