试图推送到master正在返回错误

时间:2016-07-21 06:51:10

标签: git curl

我对此很新,但我正在尝试推送到我的存储库中的master分支,而我想要推送的分支只有1GB以上。 Source Tree返回错误如下:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master

POST git-receive-pack (chunked)
error: unable to rewind rpc post data - try increasing http.postBuffer
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054

Completed with errors, see above.

我做错了什么,这是什么意思?

4 个答案:

答案 0 :(得分:15)

尝试修改git的postBuffer大小:

git config --global http.postBuffer 2097152000
git config --global https.postBuffer 2097152000

然后再次尝试推送。 (2097152000byte == 2000mb)

答案 1 :(得分:2)

请你试试

git config http.postBuffer 1310720000

并重新尝试推动。

答案 2 :(得分:2)

可能是文件大小的问题。如果您尝试上传大小大于 50 MB 的文件并且推送的整个大小大于 500 MB,那么您将收到此错误消息。还要检查您的网络速度。

为了修复缓冲区大小问题,

  1. 打开cmd

  2. 输入以下内容

     git config --global http.postBuffer 2097152000
     git config --global https.postBuffer 2097152000
    

现在 postBuffer 大小设置为 2 GB。然后你也得到相同的结果,然后你必须交叉检查网络速度。

答案 3 :(得分:0)

如果将git和git一起使用,则可能是因为git目录不归apache所有。修复

sudo chown -R www-data:www-data /path/to/my/git/repo