我的git推送在完成推送后被挂起。我要去 git推

Counting objects: 51, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (47/47), 27.64 MiB | 6.47 MiB/s, done.
Total 47 (delta 4), reused 0 (delta 0)

它挂在这里,我必须control-c才能回到命令行。我已经在过去与这个项目没有问题的几次提交。我在我的机器上尝试过其他的回购,它们工作得很好。这是怎么回事?


当前回答

在我的例子中,Git托管平台GitHub的服务器有问题,所以也要检查你的提供商状态。

其他回答

我想把@法比奥的评论附加到最初的帖子上——它帮我解决了这个问题。

我在树莓派上运行自己的临时本地git服务器。我忘记删除新的裸回购,从远程PC上执行第一次提交将无限期地挂起。

这修复了它(运行chown作为根或sudo):

cd /srv/git
chown git:git -R <repo_name>.git

将<repo_name>替换为repo的名称。

在我的情况下,这是由msysgit 1.9.5的问题引起的。降级到msysgit 1.9.4解决了这个问题。

https://git-scm.com/docs/git-config#Documentation/git-config.txt-httppostBuffer

http.postBuffer Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests. Note that raising this limit is only effective for disabling chunked transfer encoding and therefore should be used only where the remote server or a proxy only supports HTTP/1.0 or is noncompliant with the HTTP standard. Raising this is not, in general, an effective solution for most push problems, but can increase memory consumption significantly since the entire buffer is allocated even for small pushes.

决议

将Git缓冲区大小增加到回购中最大的单个文件大小 Git配置——global http。postBuffer 157286400 参考Git推送失败的解决方案-客户端打算为ngnix反向代理配置发送太大的块体。将此参数增加到回购中最大的单个文件大小。 绕过出站代理,因为git出站代理而无法克隆或拉取

这一点问题都没有。我只需要等到上传完成。我已经添加了几个大文件,没有进度指示器。也许其他人会觉得这很有用。

我有同样的问题,原来我有一个旧版本(我删除了,但有相同的名称)的回购连接到Heroku。当我断开它时,它完成了推送。