美文网首页
solution for: "fatal: bad object

solution for: "fatal: bad object

作者: 凌空_lingkong | 来源:发表于2020-02-14 21:54 被阅读0次

使用tar xf uboot_git.tar解压之后,会到git目录。可是在git目录里,git status会显示如下错误:

git status error

可以通过如下方法解决,然后就可以使用git命令来查看所做到修改了。

  1. 假设你在你的home目录~, 使用tar xf uboot_git.tar,那么你会得到~/git/目录。
    上面的错误就是说 ~/git/.git/objects/info/alternates 有问题,可以通过cat查看
  2. 首先clone一个新的u-boot
    git clone git://git.denx.de/u-boot.git ~/u-boot, 可能会花比较长到时间,等待完成
  3. 更新 ~/git/.git/objects/info/alternates
    echo "~/u-boot/.git/objects" > ~/git/u-boot-modified/git/.git/objects/info/alternates

refer to: fixing-up-a-git-repository-with-broken-alternates

相关文章

网友评论

      本文标题:solution for: "fatal: bad object

      本文链接:https://www.haomeiwen.com/subject/jyqsfhtx.html