推送到 GitHub Gist 失败。

5
尝试将PNG文件推送到我的github要点中,但没有成功。
$ git clone https://gist.github.com/6124716.git
$ cd 6124716
$ ls
fed.json     index.html     vermont.json

我可以修改index.html并将更改推送到我的github存储库。然而,一旦我将png文件保存到存储库中,我就失去了推送的能力:

$ git push
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 25.48 KiB, done.
Total 3 (delta 0), reused 0 (delta 0)
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

阅读有关该问题的资料,我看到了增加缓冲区大小的建议:

$ git config http.postBuffer 524288000

但我仍然得到了相同的错误信息。此外,vermont.json比我要上传的PNG文件要大得多。

$ ls -la
drwxr-xr-x   7 mparrilla  staff     238 Aug  2 09:53 .
drwxr-xr-x   7 mparrilla  staff     238 Aug  2 09:53 ..
drwxr-xr-x  14 mparrilla  staff     476 Aug  2 09:56 .git
-rw-r--r--   1 mparrilla  staff    5635 Aug  2 09:52 fed.json
-rw-r--r--   1 mparrilla  staff    3381 Aug  2 09:52 index.html
-rw-r--r--   1 mparrilla  staff   25776 Aug  2 09:28 thumbnail.png
-rw-r--r--   1 mparrilla  staff  187388 Aug  2 09:52 vermont.json

这似乎是你的问题? - onionjake
是的和不是。我以前曾经将PNG文件推送到gist,所以我知道这是可能的,但不确定链接答案中所报告的缺乏支持。无论如何,@donatello的解决方案对我有效。 - Matt Parrilla
啊,缺乏支持是针对API的。 - onionjake
1个回答

11

我不确定使用HTTPS的问题是什么,但作为替代方案,您可以尝试使用SSH:

要通过SSH克隆gist -

git clone git@github.com:6124716.git

嗯,行了。谢谢。有人知道那是怎么回事吗? - Matt Parrilla
2
截至2017年11月,这仍然是一个问题:无法使用HTTP推送,切换到SSH就可以了! - Giorgi Chakhidze

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接