跳转到正文
Echo Blog
返回

github项目提交者更改

用 Github 官方脚本(git filter-branch方案)

  1. filter-branch 脚本
git filter-branch --env-filter '
export GIT_AUTHOR_NAME="yinzhidong"
export GIT_AUTHOR_EMAIL="yinzhidong@users.noreply.github.com"
export GIT_COMMITTER_NAME="yinzhidong"
export GIT_COMMITTER_EMAIL="yinzhidong@users.noreply.github.com"
' -- --branches --tags

注意: GIT_AUTHOR_NAME、 GIT_AUTHOR_EMAIL 修改为你的

  1. 校验是否修改成功
git log --pretty=format:"%an <%ae> | %cn <%ce>"
  1. 临时关闭 github 邮箱保护(不推荐,会暴露真实邮箱)
  1. 强制推送
git push --force origin main

分享到:

上一篇
git快速提交代码的方式
下一篇
Claude Code 状态栏统一布局,两条数据链路:OpenRouter 直连 vs CCR 代理

评论