Git - 通过 Shell 脚本批量修改历史递交记录中的用户名和邮箱
变更记录
序号 | 录入时间 | 录入人 | 备注 |
---|---|---|---|
1 | 2017-08-29 | Alfred Jiang | - |
方案名称
Git - 通过 Shell 脚本批量修改历史递交记录中的用户名和邮箱
关键字
Git \ Shell 脚本 \ 批量修改历史递交记录
需求场景
参考链接
详细内容
1. 在仓库根目录(.git 文件所在目录)编写以下脚本并执行,替换 your-old-email@example.com
、Your Correct Name
和 your-correct-email@example.com
为你需要修改的
1 | !/bin/sh |
2. 执行以下命令将修改后的仓库历史推到远程
1 | git push --force --tags origin 'refs/heads/*' |
效果图
(无)
备注
(无)
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 宁静至远,博雅多通!