> git fsck
error in commit %hash%: invalid author/committer line - bad time zone
> git show %hash%
Date: Mon Mar 18 23:57:14 2201 -5274361
如何解决这个问题?在 master 分支中使用 git rebase
并删除\更新提交信息,或者在项目 .git
目录中做一些魔术,或者以其他方式?
最佳答案
我会选择 git rebase -i
解决方案。
编辑错误的提交并在停止时 git commit --amend --date="Mon Jul 24 14:00 2015 +0100"
。
如果您基于推送的提交进行 rebase ,则必须通过执行 push -f
来重写分支历史记录(在您的情况下为 master
)。
关于git commit 打破时区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30393584/