首先,我们创建change.sh脚本,并根据个人信息复制以下脚本。 #!/bin/sh

git filter-branch --env-filter ' OLD_EMAIL="填写原来的邮箱" CORRECT_NAME="填写现在的名称" CORRECT_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

将脚本移入要修改的git仓库,并执行脚本。修改后的 log 信息如下。

3

通过git push --force强行推送修改后的 log 信息。

哈哈,我的 github又重新绿了起来。

 

https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi?rq=1 https://help.github.com/articles/changing-author-info/

相关文章:

  • 2022-02-08
  • 2021-08-26
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-09-14
  • 2021-08-21
  • 2022-01-15
  • 2021-06-10
  • 2022-01-15
  • 2021-05-13
  • 2021-04-10
相关资源
相似解决方案