我的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才能回到命令行。我已经在过去与这个项目没有问题的几次提交。我在我的机器上尝试过其他的回购,它们工作得很好。这是怎么回事?


当前回答

我在推送到GitHub时也遇到了同样的问题。我发现有一部分被推送的文件没有被接受。

我发现这是通过把我的大提交分解成小的提交(正如这个SO问题所描述的:把以前的提交分解成多个提交),然后在大多数小的部分中找到成功。

问题部分包含图像文件,我仍在整理哪个特定文件(或多个文件)触发了问题。

其他回答

添加另一个本地提交并重新尝试推送对我来说是有效的。

问题是上传文件太大了。

要么等待,要么转到项目文件夹,删除在使用maven时可以在目标文件夹中找到的所有库。那就推一下,很快就会发生的。

无论如何,库文件夹不需要存储在git中,这只是浪费git空间,除非它们在maven存储库中不可用,而你真的需要存储它们

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出站代理而无法克隆或拉取

签出git正在使用的用户权限!

在我的情况下,我尝试通过ssh和使用的系统用户无法写入到git裸库…

下面是调试ssh连接的方法

查看是否已经进行了阶段性但未提交的更改。(git状态)

如果是,提交(或取消)这些文件,然后尝试推送。为我工作。