Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push to github gist failing

Tags:

git

github

gist

Trying to push a PNG to my github gist without success.

$ git clone https://gist.github.com/6124716.git
$ cd 6124716
$ ls
fed.json     index.html     vermont.json

I can then modify index.html and push the change to my github repository. However once I save a png file to the repo I lose the ability to push:

$ 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

Reading about the problem, I've seen suggestions to increase the buffer size:

$ git config http.postBuffer 524288000

But I still get the same error message. Furthermore, vermont.json is much larger than the PNG I am trying to upload.

$ 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
like image 820
Matt Parrilla Avatar asked Aug 02 '13 13:08

Matt Parrilla


People also ask

Why can't I push to GitHub?

Simply put, git cannot make the change on the remote without losing commits, so it refuses the push. Usually this is caused by another user pushing to the same branch. You can remedy this by fetching and merging the remote branch, or using pull to perform both at once.

Do GitHub gists expire?

No, they don't expire. The documentation says: Warning: Anonymous gists cannot be deleted from the web. To have an anonymous gist deleted, contact GitHub support.

Can I push to any GitHub repo?

No, but if the repository is public others can fork it, commit to their own fork. They can then ask you to pull some of the changes in their fork into your repository via a pull-request. Show activity on this post. Nobody can push directly to your repository if you are not already granting them write access.


1 Answers

I am not sure what the problem is with using HTTPS, but as an alternative you could trying using SSH:

To clone a gist via SSH -

git clone [email protected]:6124716.git
like image 139
donatello Avatar answered Oct 22 '22 09:10

donatello