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


当前回答

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

其他回答

我最近在尝试总共推送大约2MB的40个文件时得到了这个。git push——verbose没有显示错误,但是在Total <…日志含义>写入终端。

我通过GitHub重新发布了一个新的PAT,推送如预期的那样进行了。

此问题可能是由SSH代理的问题引起的。

我最近遇到了这个问题,因为我将默认shell从zsh更改为bash。我最初使用zsh设置我的ssh密钥,所以它们在默认情况下对bash不可用,使用chsh -s /bin/bash

为了解决这个问题,你需要使用相同的shell脚本(bash, sh, zsh等)将你的ssh密钥添加到ssh身份验证代理,你正在使用它来执行git命令:

eval `ssh-agent`
ssh-add ~/.ssh/some_key_rsa

为了添加密钥,您需要输入密钥的口令。要将密码短语存储到用户密钥链中,这样就不需要在每次使用密钥时都输入它,可以将带有-K选项的密钥添加到ssh-add命令中。

ssh-add -K ~/.ssh/some_key_rsa

注意,使用大写K时使用小写K是不同的命令选项。

对我来说,当我切换到bash而不是zsh终端时,它就工作了。

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

它可以(正如公认的答案所暗示的那样)等待片刻,但在大多数情况下,它与远程上的权限相关联。 虽然在GitHub、Gitlab或Bitbucket等公共git服务上大多数情况下都不是问题,但自托管远程服务器可能有一个特殊的用户或组来访问。

在新的裸存储库中,改变文件夹是不够的, 但需要递归,因为里面有。git- folder。