美文网首页
单独修改 Git 已经提交记录中的作者和提交人 信息和提交时间

单独修改 Git 已经提交记录中的作者和提交人 信息和提交时间

作者: 小白lf | 来源:发表于2022-07-21 15:05 被阅读0次

修改提交人

git rebase -i --root
点击键盘 i 键, 进入编辑模式
把想要修改的节点 的 pick 改成 edit
esc 退出编辑模式
:wq  保存退出
git commit --amend --author="liufei <liufei@eee.com>" --no-edit
git rebase --continue
一直到 successfully

修改提交时间

git rebase -i --root
点击键盘 i 键, 进入编辑模式
把想要修改的节点 的 pick 改成 edit
esc 退出编辑模式
:wq  保存退出
GIT_COMMITTER_DATE="2022-07-14T19:31:03" git commit --amend --date="2022-07-14T19:31:03" --no-edit
git rebase --continue
一直到 successfully

时间格式:
2022年7月21日 GMT+8 上午11:03:06  ==> 2022-07-21T11:03:06
2022年7月21日 GMT+8 下午2:03:06  ==> 2022-07-21T14:03:06

相关文章

网友评论

      本文标题:单独修改 Git 已经提交记录中的作者和提交人 信息和提交时间

      本文链接:https://www.haomeiwen.com/subject/apiuirtx.html