我使用 subtree
这个git子命令来拆分出了一个子项目,由于更换邮箱,我还需要修改这个项目每个commit的作者相关信息。
我试图设置全局作者信息然后使用git rebase -r --root --exec "git commit --amend --no-edit --reset-author"
来完成这个操作。但是随后发现commit的日期也发生了变化,我不想这么搞。
最后我在https://stackoverflow.com/questions/750172/how-do-i-change-the-author-and-committer-name-email-for-multiple-commits上找到了一个解决方案:git filter-branch --env-filter 'export GIT_AUTHOR_NAME=author;export GIT_AUTHOR_EMAIL=email@example.com'
。经过测试发现没有修改日期,完成了需求。