11
git push -u origin main

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

send-pack: unexpected disconnect while reading sideband packet

fatal: the remote end hung up unexpectedly

Everything up-to-date

i tried,
git config http.postBuffer 524288000 but it didn't worked

2
  • 1
    Please edit your question to include git config -l --show-origin as a code block (not an image). Also, the Git FAQ is clear that http.postBuffer should not be used in normal circumstances and usually only serves to waste memory. Commented Jan 15, 2024 at 22:19
  • What's the output of GIT_CURL_VERBOSE=1 git push -u origin main? Commented Jan 16, 2024 at 17:31

3 Answers 3

28

Follow few steps:

  1. Since Git LFS 2.2.0 you can use git lfs migrate command. In your case it would look this way:

git lfs migrate import --include="*.csv"

  1. When pushing a large amount of data (initial push of a big repository, change with very big file(s)) may require a higher http.postBuffer setting on your git client (not the server). Increase the Git buffer size to the largest individual file size of your repo:

git config --global http.postBuffer 524288000

  1. Push your code in origin/relevant branch:

git push -u origin main

After this, you should be able to push changes into origin branch.

Sign up to request clarification or add additional context in comments.

Comments

11

For me, I tried brew install git and the error is gone

1 Comment

For me as well, I was encountering similar (underlying) issue while using (gh cli) gh pr create, and switching git cli from Apple's (stock) git version 2.39.3 (Apple Git-146) to git version 2.46.0 (current in brew), made it work. Hence, I wonder if we face some incompatibility vs older versions of Git.
7

For me, I tried git config --global http.postBuffer 157286400 and the error is gone.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.