我试图使用以下命令克隆 Android Goldfish 内核源代码,
git clone https://android.googlesource.com/kernel/goldfish
但是因为它需要下载大约 900MB 的数据,所以我想到了这到底是怎么回事,并经历了这个,
git clone https://android.googlesource.com/kernel/goldfish --branch android-goldfish-3.4 --depth 1
这将下载大小减少到 120MB 左右,下载完成,但在解压对象时出错。
后来当我使用时,git status
我看到大量文件被删除,并且显示为好像它们甚至没有添加和提交。我愚蠢地添加了它们并将它们提交为名为'local commit' 的新提交。
git log --oneline
ca6ded2 Local Commit
2a51970 Merge branch 'android-3.4' into android-goldfish-3.4
c9cb2c8 UPSTREAM: netfilter: x_tables: fix unconditional helper
ac342b9 Merge branch 'android-3.4' into android-goldfish-3.4
现在检查远程文件后,很明显显示已删除和我提交的文件在远程但未在本地显示。所以我试图重置为之前的提交。但是显示了这些错误:
git reset 2a51970
error: failed to read object b56d12bf5900c8f266132bc9b50dadfb092af10a at offset 26783674 from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack
fatal: packed object b56d12bf5900c8f266132bc9b50dadfb092af10a (stored in .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack) is corrupt
fsck 显示如下:
git fsck
Checking object directories: 100% (256/256), done.
error: .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack SHA1 checksum mismatch
error: index CRC mismatch for object b56d12bf5900c8f266132bc9b50dadfb092af10a from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 26783674
error: cannot unpack b56d12bf5900c8f266132bc9b50dadfb092af10a from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 26783674
error: index CRC mismatch for object 6149b476d9dffe06bcd1e3e3136bc335fd3dbf98 from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 27883077
error: inflate: data stream error (invalid distance too far back)
error: cannot unpack 6149b476d9dffe06bcd1e3e3136bc335fd3dbf98 from .git/objects/pack/pack-3ce58ac57f33a98f718e926caccca5ea5fa3a1fd.pack at offset 27883077
Checking objects: 100% (41134/41134), done.
我的问题: 有没有办法在不重新启动克隆过程的情况下解决这个问题。并且克隆是否正确完成或我在那里做错了什么?
谢谢你。