Git fails when pushing commit to github
Solution 1:
I had the same issue and believe that it has to do with the size of the repo (edited- or the size of a particular file) you are trying to push.
Basically I was able to create new repos and push them to github. But an existing one would not work.
The HTTP error code seems to back me up it is a 'Length Required' error. So maybe it is too large to calc or greated that the max. Who knows.
EDIT
I found that the problem may be files that are large. I had one update that would not push even though I had successful pushes up to that point. There was only one file in the commit but it happened to be 1.6M
So I added the following config change
git config http.postBuffer 524288000
To allow up to the file size 500M and then my push worked. It may have been that this was the problem initially with pushing a big repo over the http protocol.
END EDIT
the way I could get it to work (EDIT before I modified postBuffer) was to tar up my repo, copy it to a machine that can do git over ssh, and push it to github. Then when you try to do a push/pull from the original server it should work over https. (since it is a much smaller amount of data than an original push).
Solution 2:
If this command not help
git config http.postBuffer 524288000
Try to change ssh method to https
git remote -v
git remote rm origin
git remote add origin https://github.com/username/project.git
Solution 3:
Looks like a server issue (i.e. a "GitHub" issue).
If you look at this thread, it can happen when the git-http-backend
gets a corrupted heap.(and since they just put in place a smart http support...)
But whatever the actual cause is, it may also be related with recent sporadic disruption in one of the GitHub fileserver.
Do you still see this error message? Because if you do:
- check your local Git version (and upgrade to the latest one)
- report this as a GitHub bug.
Note: the Smart HTTP Support is a big deal for those of us behind an authenticated-based enterprise firewall proxy!
From now on, if you clone a repository over the
http://
url and you are using a Git client version 1.6.6 or greater, Git will automatically use the newer, better transport mechanism.
Even more amazing, however, is that you can now push over that protocol and clone private repositories as well. If you access a private repository, or you are a collaborator and want push access, you can put your username in the URL and Git will prompt you for the password when you try to access it.Older clients will also fall back to the older, less efficient way, so nothing should break - just newer clients should work better.
So again, make sure to upgrade your Git client first.