> 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
这个问题应该怎样解决?可以在主分支上使用
git rebase
删除或更新提交信息,或者在项目的.git
目录中进行一些操作,或者使用其他方法吗?我建议采用 git rebase -i
解决方案。
编辑错误的提交,遇到它们时使用 git commit --amend --date="Mon Jul 24 14:00 2015 +0100"
进行修改。
如果你在已推送的提交上变基,你将需要通过执行 push -f
重写分支历史(在你的情况下是 master
分支)。
编辑:如果变基选项无法正常工作.. 我会放弃尝试修复仓库..
我会选择快速导出和快速导入..
git fast-export --all | (cd /cleanrepo/ && git fast-import)
如果上述方法失败,我会添加--anonymize
以删除所有识别信息。
git cat-file -p %hash%
吗? - Matthieu Moy