160

I have just setup git with bit bucket for my windows machine.

Git pull works properly, where as git push fails with below error.

$ git push
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 174.03 KiB | 0 bytes/s, done.
Total 10 (delta 6), reused 0 (delta 0)
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 Internal Server Error
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

Any help is of great use.

Thanks

5
  • 2
    take a look it might help. confluence.atlassian.com/bitbucketserverkb/… Commented Jun 27, 2017 at 12:30
  • it didn't work either Commented Jun 27, 2017 at 12:34
  • HTTP 500 is a server-side error. Are you using Bitbucket Cloud (hosted on bitbucket.org) or Bitbucket Server (self-hosted)? Commented Jun 27, 2017 at 16:50
  • It's bitbucket cloud. Moreover it's working with other fellow teammates. I have cross verified username too. I suspect something went wrong in configuration files Commented Jun 28, 2017 at 6:27
  • I have posted a solution which is present at stackoverflow.com/a/78814683/13127848 Commented Aug 1, 2024 at 14:41

13 Answers 13

482

Increase the global Git buffer size to the largest individual file size:

git config --global http.postBuffer 157286400

Or just for your repo:

cd your_repo
git config http.postBuffer 157286400
Sign up to request clarification or add additional context in comments.

10 Comments

I had the OP problem with SourceTree, this answer has solved it for me.
I tried change the git password in windows credential store, without success, the issue was actually increasing the buffer size. Thanks a lot!
Thanks! I resolved the issue by increasing the buffer size to 524288000 using the same command: git config --global http.postBuffer 524288000
tried that line and the error changed to fatal: protocol error: bad line length 81922 GiB | 31.06 MiB/s. Anyone knows why?
worked perfectly. I did have several large files in this commit. (very rarely updated, but several of them in one commit).
|
42

When You Pushed More Files or Merge More Commits In Git and Get This Error.

RPC failed; HTTP 500 curl 22 The requested URL returned error: 500

Open Your Terminal and Execute Below Command:

git config --global http.postBuffer 157286400

OR Set Your repo path in Terminal and Execute Below Command:

git config http.postBuffer 157286400

Comments

19

I appreciate this is an old question, but the previous suggestions didn't work for me (I was getting the same error from git fetch). What worked for me was:

git gc
git fsck

1 Comment

8

I don't know when in the future you'll be reading this question, but before trying every solution in here maybe check the Github Status Page, or the status page for your Git platform. I had a very similar problem on January 9, 2024 and tried a lot of stuff before realizing it was just a problem with Github itself, and all I could do was wait.

3 Comments

Currently I've got the Github failure when running 'git pull'
That's exactly what's happening now: We are currently investigating failures on all Git operations, including both SSH and HTTP.
The people's hero. Glad to see the link still works. And that it's not my fault git is broken.
6

This happened to me because I had a no space left on device error...my server hard drive was full and could not write any files !

A short term option can be to delete all temporary files to free space and unfreeze the machine.

Comments

4

In my case this same error showed up when I had old credentials saved in the git credentials store.

Updating the credentials in the ~/.git-credentials file solved the issue for me.

Comments

2

I got this error when pushing a single commit of many large image files to GitHub. The solution was to undo this large commit and instead do five separate smaller commits and pushing each time. This way, less data is committed and pushed each time. I was able to push each of these batches successfully. Hope this helps someone.

Comments

2

I encountered this problem and solved it by updating the main and switching back to brunch. After this, I pushed again and the message disappeared.

Comments

2

I know this question is about Windows, but I encountered the same issue on macOS and wanted to share my solution for other macOS users who might find this post.

Solution for macOS using GUI (no terminal required):

  1. Open Sourcetree application

  2. Go to Repository → Repository Settings

  3. Click the Advanced tab

  4. Select "Edit Config File"

  5. Add the following to the config file:"

[http]
    postBuffer = 157286400

enter image description here

Comments

1

I had a similar issue and solution was to do a get fetch. After that I was able to do a git push too.

Comments

0

In my case the above solution didn't solve the problem. I've tried switch to ssh and found out that the problem were 2 big files, over 2GB, that weren't accepted by Github.

I excluded them in the .gitignore file, and then it worked properly.

Comments

0

Got this error when doing a git push --mirror when migrating a repository to GitHub.

To trouble shoot I pushed each branch separately and on one of them I got a better error message indicating that one of the commits was violating a repository ruleset.

Comments

0

TLDR: Similar problem, that was fixed by increasing git buffer size.

I get the same problem while doing a push to bitbucket. Initially I thought that this is a remote problem, since I got 500, but no.

My case was that I did a big increment (88 files changed over many commits), and then made a merge with development branch, that also had a significant amount of work done.

All this resulted in 500 error failure on push. (pull or fetch worked nicely)

I found two related articles on Bitbucket support, fist suggested to check if repo is not corrupted. https://confluence.atlassian.com/bitbucketserverkb/unable-to-push-to-bitbucket-server-repository-779171784.html

And this article that suggested to increase the http buffer size.

https://confluence.atlassian.com/bitbucketserverkb/git-push-fails-fatal-the-remote-end-hung-up-unexpectedly-779171796.html#:~:text=git%2Dconfig.html-,http.postBuffer,is%20sufficient%20for%20most%20requests.

Now all works as expected.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.