我在谷歌上搜索过,找到了很多解决方案,但没有一个适合我。

我试图通过连接到LAN网络中的远程服务器从一台机器克隆。 在另一台机器上运行此命令会导致错误。 但是使用git运行相同的克隆命令://192.168.8.5…在服务器上,这是正常的并且成功的。

有什么想法吗?

user@USER ~
$ git clone  -v git://192.168.8.5/butterfly025.git
Cloning into 'butterfly025'...
remote: Counting objects: 4846, done.
remote: Compressing objects: 100% (3256/3256), done.
fatal: read error: Invalid argument, 255.05 MiB | 1.35 MiB/s
fatal: early EOF
fatal: index-pack failed

我已经在.gitconfig中添加了这个配置,但也没有帮助。 使用git版本为1.8.5.5.2 .msysgit.0

[core]
    compression = -1

当前回答

这些对我来说都没用,但使用Heroku的内置工具却奏效了。

heroku git:clone -a myapp

文档在这里:https://devcenter.heroku.com/articles/git-clone-heroku-app

其他回答

我也有同样的问题。遵循上面的第一步,我能够克隆,但我不能做任何其他事情。不能取、拉或结帐旧树枝。

每个命令运行得比平时慢得多,然后在压缩对象后终止。

I:\dev [master +0 ~6 -0]> git fetch --unshallow
remote: Counting objects: 645483, done.
remote: Compressing objects: 100% (136865/136865), done.

error: RPC failed; result=18, HTTP code = 20082 MiB | 6.26 MiB/s

fatal: early EOF

fatal: The remote end hung up unexpectedly

fatal: index-pack failed

这也发生在你的裁判使用太多内存的时候。修剪记忆为我解决了这个问题。只要给你取回的东西加上一个限制,比如->

git fetch --depth=100

这将获取历史记录中最近100次编辑的文件。 在此之后,您可以以正常速度执行任何命令。

虽然不是完全相同的设置,但我在Ubuntu 20.04上挂载nfs共享时遇到了这个问题。我还没有找到任何解决方案,所以我分享了我是如何解决的,希望我能帮助到别人。

错误消息是(有时带有/没有警告):

warning: die() called many times. Recursion error or racy threaded death!
fatal: premature end of pack file, 29 bytes missing
fatal: premature end of pack file, 24 bytes missing
fatal: index-pack failed

Git浅克隆,禁用压缩等并没有解决这个问题。

当我用nfsvers=4.2而不是nfsvers=4.0挂载共享时,问题消失了。

此错误可能发生在git的内存需求。您可以将这些行添加到全局git配置文件中,即$USER_HOME中的.gitconfig,以解决这个问题。

[core] 
packedGitLimit = 512m 
packedGitWindowSize = 512m 
[pack] 
deltaCacheSize = 2047m 
packSizeLimit = 2047m 
windowMemory = 2047m

对我来说,当我把压缩改为 Git配置——global core.compression

这是

这些对我来说都没用,但使用Heroku的内置工具却奏效了。

heroku git:clone -a myapp

文档在这里:https://devcenter.heroku.com/articles/git-clone-heroku-app