我最近尝试将存储库(从Bitbucket)导入GitHub,并且导入失败。 GitHub技术支持使我意识到他们在存储库中看到“不良日期”问题,因此我应该在存储库上运行git fsck
。所以我从BitBucket克隆了它,然后运行git fsck
,这就是我得到的:
git fsck Checking object directories: 100% (256/256), done.
error in commit fda45b4b6b06f6b815341c1f26de827c769f48b6: badDate: invalid
author/committer line - bad date error in commit
636d259fd0ac343af2a5561ff799a54a6aeb9b1c: badDate: invalid
author/committer line - bad date error in commit
41dc786816992e3c42c904e8c848aa1078475386: badDate: invalid
author/committer line - bad date error in commit
c55a0fa0d98e02aa4621be202d7b7d21ed2ff2ab: badDate: invalid
author/committer line - bad date error in commit
e6ad8f5ea7cf6441b6ea6ab5583117113a8f49fb: badDate: invalid
author/committer line - bad date error in commit
4aea97fdd999484319a9fbbc4dc42b024e1eba80: badDate: invalid
author/committer line - bad date error in commit
531f7783e383868c1d52a1bf2dc3212f5e10a91c: badDate: invalid
author/committer line - bad date Checking objects: 100% (546/546),
done.
天哪,这是怎么发生的?我什至不知道如何开始解决该问题。搜索“不良约会”并没有产生任何有用的建议。
一种善良的git guru会引导我朝正确的方向吗?
作为illustrated here,git cat-file
将有助于查看作者/提交者的格式
示例:
'git log'不会按原样显示提交对象的标头,而是'gitcat-file'确实:
git cat-file
自 $ git cat-file -p c609265ccce27a902b850f5d62e6628710ee2928
tree ea8e3bd64e67d159e706b8feccfc169f6ac0829d
parent db4e80ee11a4e212a97efc1761ed237c7da72cb1
author Richard W.M. Jones <rjones@xxxxxxxxxx> <"Richard W.M. Jones <rjones@xxxxxxxxxx>"> 1254739168 +0100
committer Richard W.M. Jones <rjones@xxxxxxxxxx> <"Richard W.M. Jones <rjones@xxxxxxxxxx>"> 1254739168 +0100
New translations.
起,考虑git filter-branch
is declared deprecated将那些作者/提交者固定为git filter-branch
。
但是:历史记录将被重写,在您的情况下(迁移)可能还可以。