gpt4 book ai didi

git - 如何修复 git 存储库中的 "bad date"问题?

转载 作者:行者123 更新时间:2023-12-05 02:58:12 26 4
gpt4 key购买 nike

我最近尝试将存储库导入 GitHub(来自 Bitbucket),但导入失败。 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.

天哪,那是怎么发生的?我什至不知道如何开始解决这个问题。搜索“bad date”没有得到任何有用的建议。

好心的 git 大师会引导我朝着正确的方向前进吗?

最佳答案

作为illustrated here , 一个 git cat-file将有助于查看作者/提交者的格式

例子:

'git log' 不会按原样显示提交对象的 header ,但是 'git猫文件'做:

  $ 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 , 考虑 newren/git-filter-repo修复这些作者/提交者,如 in here .

但是:历史将被重写,这对您的情况(迁移)可能没问题。

关于git - 如何修复 git 存储库中的 "bad date"问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59231306/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com