I recently tried to import a repository into GitHub (from Bitbucket) and the import was failing. GitHub tech support imformed me that they were seeing "bad date" issues in the repository and that I should run git fsck on the repository. So I cloned it from BitBucket and ran git fsck and this is what I get:
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.
Well gosh, how did THAT happen? I have no idea how to even begin to fix that. Searching for "bad date" hasn't yielded any useful advice.
Would a kind git guru care to steer me in the right direction?
As illustrated here, a
git cat-filewould help to see the format for author/commiterExample:
'git log' doesn't show the commit object's headers as-is, but 'git cat-file' does:
Since
git filter-branchis declared deprecated, considernewren/git-filter-repoto fix those authors/committers, as in here.But: the history will be rewritten, which might be OK in your case (migration).