git push fails: RPC failed; result=22, HTTP code = 411

后端 未结 5 1988
星月不相逢
星月不相逢 2020-12-22 15:32

I have only one branch. For a few months I have been using

git push origin master

to commit to my local repository. Last night after I made

相关标签:
5条回答
  • 2020-12-22 15:40

    You can also do this globally -

    git config --global http.postBuffer 524288000
    

    That will allow all local repos to push up to 500MB of data.

    0 讨论(0)
  • 2020-12-22 15:42

    If you attempt to push a large set of changes to a Git repository with HTTP or HTTPS, you may get an error message such as error: RPC failed; result=22, HTTP code = 411. This is caused by a Git configuration default which limits certain HTTP operations to 1 megabyte.

    To change this limit run within your local repository

    git config http.postBuffer *bytes*
    

    where bytes is the maximum number of bytes permitted. For example:

    git config http.postBuffer 524288000
    

    For 500MB (thanks @Hengjie)

    0 讨论(0)
  • 2020-12-22 15:58

    None of the solutions provided worked for us. We had to switch to ssh to make this work instead of the HTTPS solution.

    0 讨论(0)
  • 2020-12-22 15:58

    I solved the 22 error as follows: In the "git clone" command I did NOT supply the user:password. The clone worked, but not the push. Solution for the 22 error: Modify .git/config the url like this: url=http://user:pwd@host/... Then, the push worked.

    0 讨论(0)
  • 2020-12-22 16:03

    If you are using TortoiseGit for Windows, the easiest way is using the integrated configuration.

    In a file explorer press left mouse button, select TortoiseGit -> Settings. Accept the info message. Now, you can choose if you want to configure the property only for the current project or system whide. For systemwide configuration press "edit systemwide gitconfig" and add the next line to the section [http]:

    postBuffer = 524288000
    

    (it the section [http] doesn't exist, create it)

    0 讨论(0)
提交回复
热议问题