153

Githubの愚かな問題が現在進行中です。かなりの量の変更(サイズが約120MB)があります。プッシュしようとすると、次のようになります。

error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly 
fatal: The remote end hung up unexpectedly

私はすでにやった

git config http.postBuffer 524288000、それは問題ではないようです。どうなり得るか?

4

18 に答える 18

240

エラー413が発生した場合、問題はgitではなく、Webサーバーにあります。大きなアップロードファイルをブロックしているのはWebサーバーです。

nginxのソリューション

をロードして、httpブロックnginx.confに追加client_max_body_size 50m;(必要に応じて値を変更)するだけです。

実行して新しい構成を受け入れるようにnginxをリロードしsudo service nginx reload、httpを介してコミットをプッシュして再試行します。

Apacheのソリューション

ブロック内のhttpd.conf追加LimitRequestBody 52428800(必要に応じて値を変更) 。<Directory />これを行うと、サーバーファイルシステム全体、単一の仮想ホストまたはディレクトリのみの要求を制限できます。

これがお役に立てば幸いです。

于 2013-02-22T10:16:12.720 に答える
59

私はそれを考え出した!!!もちろん、ポストを打った直後に!

HTTPS URLを使用するようにリポジトリを設定し、SSHアドレスに変更すると、すべてが問題なく動作を再開しました。

于 2011-09-20T18:17:58.280 に答える
39

リモートURLを変更するコマンド(https-> git @ ...から)は次のようなものです

git remote set-url origin git@github.com:GitUserName/GitRepoName.git

ここでのoriginは私のリモートの名前です(git remoteを実行すると、出てくるのはあなたのoriginです)。

于 2011-10-10T00:10:58.393 に答える
13

同じ問題が発生しましたが、リバースプロキシを使用していました。

だから私は設定しなければなりませんでした

client_max_body_size 50m; 

両方の構成ファイル内:

  • gitlab nginx Webサーバー上(前の回答で述べたように)
  • 専用サーバーでホストされているnginxリバースプロキシでも同様です。
于 2015-05-05T21:35:41.437 に答える
11

大きなサイズの変更をプッシュしているときにこの問題が発生した場合は、ターミナルで以下のコマンドを実行してください。

git config --global http.postBuffer 157286400

詳細については、こちらをご覧ください。

于 2018-10-22T16:31:13.463 に答える
6

私はすでにgitURLに「HTTPS//」を持っていましたが、このエラーに直面しました。

私がしたのは、プッシュでオプション-uを追加することだけで、それは機能しました。

git push -u origin master

于 2013-08-20T15:17:19.233 に答える
4

IIS7を使用してgit http/httpsエンドポイントをホストする場合:

あなたはあなたのを増やす必要がありますuploadReadAheadSize

インターネットインフォメーションサービス(IIS)マネージャーを起動する

  1. [サーバー]フィールドを展開します

  2. サイトを展開する

  3. 変更するサイトを選択します。

  4. [機能]セクションで、ダブルクリックしますConfiguration Editor

  5. 選択の下でSectionsystem.webServer > serverRuntime

  6. セクションを変更しuploadReadAheadSizeます(値はとの間0でなければなりません2147483647)。

  7. クリックApply

  8. Webサイトを再起動します

于 2014-04-17T07:51:34.780 に答える
2

sshリンクの代わりにhttpsリンクを使用していますか?httpsリンクはHttpServer(Apache、Ngnixなど)のアップロードのサイズによって制限されるため、sshを使用する場合はそのような制限はありません。

次の方法を使用して、sshリンクに切り替えます。

  1. ターミナルを開きます。
  2. プロジェクトの作業ディレクトリに切り替えます。
  3. リモートリポジトリの名前を取得します
$ git remote -v
origin  https://github.com/[user_name]/[project_name].git (fetch)
origin  https://github.com/[user_name]/[project_name].git (push)
  1. gitアドレスをsshリンクに変更します。
git remote set-url origin git@github.com:[user_name]/[project_name].git

リモートリポジトリ名を決定したら、ステップ4に直接進みます。これで、プッシュ操作を楽しく実行できます。

于 2019-07-16T07:55:20.387 に答える
1

このエラーは、httpsアップロードの基礎となるプロトコルである「libcurl」で発生します。解決策は、どういうわけかlibcurlをアップグレードすることです。エラーの詳細を取得するには、GIT_CURL_VERBOSE=1を設定します

https://confluence.atlassian.com/pages/viewpage.action?pageId=306348908

libcurl docによるエラーの意味:CURLE_HTTP_RETURNED_ERROR(22)

これは、CURLOPT_FAILONERRORがTRUEに設定されていて、HTTPサーバーが400以上のエラーコードを返した場合に返されます。

http://curl.haxx.se/libcurl/c/libcurl-errors.html

于 2012-12-12T03:25:38.640 に答える
1

Linuxマシンでgitリポジトリのクローンを作成しようとすると、この問題が発生しました。

次のURLはWindowsで機能しています

http://swamy@git.swamy.com/scm/project/swamy-main.git

一方、次のURLはLinuxマシンで機能し、URLにhttpsが含まれています

https://swamy@git.swamy.com/scm/project/swamy-main.git
于 2013-08-03T16:00:09.373 に答える
1

最初のコミットを新しいBitBucketリポジトリにプッシュしようとすると、このエラー(エラー:RPCが失敗しました;結果= 22、HTTPコード= 413 )が発生しました。BitBucketリポジトリにマスターブランチがなかったため、エラーが発生しました。SourceTreeを使用している場合は、 Git Flowボタンを押すことで、オリジンにマスターブランチを作成できます。

于 2015-03-10T16:26:55.403 に答える
1

リモートURLをsshまたはhttpsに変更する必要があります

git remote set-url origin git@github.com:laravel/laravel.git

また

git remote set-url origin https://github.com/laravel/laravel.git

願わくば、これがお役に立てば幸いです:)

于 2019-04-17T16:09:02.490 に答える
0

同じ問題が発生しました(Win XPの場合)。Gitbinディレクトリのlibcurl-4.dllファイルをhttp://www.paehl.com/open_source/?download=curl_DLL_ONLY.7zからSSLバージョンに更新しました(名前を変更します) libcurl4.dllへ)。すべて正常に動作しています。

于 2013-01-28T16:16:11.583 に答える
0

https要点のクローンが失敗します(sshは機能します。以下を参照):

12:00 jean@laptop:~/tmp$ GIT_CURL_VERBOSE=1 git clone https://gist.github.com/123456.git username
Initialized empty Git repository in /home/jean/tmp/username/.git/
* Couldn't find host gist.github.com in the .netrc file; using defaults
* About to connect() to gist.github.com port 443 (#0)
*   Trying 192.30.252.142... * Connected to gist.github.com (192.30.252.142) port 443 (#0)
* found 141 certificates in /etc/ssl/certs/ca-certificates.crt
*        server certificate verification OK
*        common name: *.github.com (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com
*        start date: Mon, 30 Apr 2012 00:00:00 GMT
*        expire date: Wed, 09 Jul 2014 12:00:00 GMT
*        issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance CA-3
*        compression: NULL
*        cipher: ARCFOUR-128
*        MAC: SHA1
> GET /123456.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept: */*
Pragma: no-cache

< HTTP/1.1 301 Moved Permanently
< Server: GitHub.com
< Date: Fri, 01 Nov 2013 05:00:51 GMT
< Content-Type: text/html
< Content-Length: 178
< Location: https://gist.github.com/gist/123456.git/info/refs?service=git-upload-pack
< Vary: Accept-Encoding
<
* Ignoring the response-body
* Expire cleared
* Connection #0 to host gist.github.com left intact
* Issue another request to this URL: 'https://gist.github.com/gist/123456.git/info/refs?service=git-upload-pack'
* Couldn't find host gist.github.com in the .netrc file; using defaults
* Re-using existing connection! (#0) with host gist.github.com
* Connected to gist.github.com (192.30.252.142) port 443 (#0)
> GET /gist/123456.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept: */*
Pragma: no-cache

< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Fri, 01 Nov 2013 05:00:52 GMT
< Content-Type: application/x-git-upload-pack-advertisement
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
<
* Connection #0 to host gist.github.com left intact
* Couldn't find host gist.github.com in the .netrc file; using defaults
* About to connect() to gist.github.com port 443 (#0)
*   Trying 192.30.252.142... * connected
* Connected to gist.github.com (192.30.252.142) port 443 (#0)
* found 141 certificates in /etc/ssl/certs/ca-certificates.crt
* SSL re-using session ID
*        server certificate verification OK
*        common name: *.github.com (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com
*        start date: Mon, 30 Apr 2012 00:00:00 GMT
*        expire date: Wed, 09 Jul 2014 12:00:00 GMT
*        issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance CA-3
*        compression: NULL
*        cipher: ARCFOUR-128
*        MAC: SHA1
> POST /123456.git/git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept-Encoding: deflate, gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 116

< HTTP/1.1 301 Moved Permanently
< Server: GitHub.com
< Date: Fri, 01 Nov 2013 05:00:53 GMT
< Content-Type: text/html
< Content-Length: 178
< Location: https://gist.github.com/gist/123456.git/git-upload-pack
< Vary: Accept-Encoding
<
* Ignoring the response-body
* Connection #0 to host gist.github.com left intact
* Issue another request to this URL: 'https://gist.github.com/gist/123456.git/git-upload-pack'
* Violate RFC 2616/10.3.2 and switch from POST to GET
* Couldn't find host gist.github.com in the .netrc file; using defaults
* Re-using existing connection! (#0) with host gist.github.com
* Connected to gist.github.com (192.30.252.142) port 443 (#0)
> GET /gist/123456.git/git-upload-pack HTTP/1.1
User-Agent: git/1.7.1
Host: gist.github.com
Accept-Encoding: deflate, gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result

* The requested URL returned error: 400
* Closing connection #0
error: RPC failed; result=22, HTTP code = 400

これは機能します:git clone git@gist.github.com:123456.git

于 2013-11-01T05:14:33.547 に答える
0

同じ問題に直面していました。私の場合、同じプロジェクトにアクセス(プル/プッシュ)している複数のユーザー間で互換性のないGITバージョンでした。

GITバージョンを更新し、Android Studio設定のパスを更新しましたが、正常に機能しています。

編集 -

Git for Windows(1.9.5)に問題がある場合は、同じものを更新すると役立つ場合があります。

于 2016-02-03T11:37:00.137 に答える
0

同じ問題に直面していましたが、gitリポジトリをクリーンアップすることで解決しました(「gitclean」を使用して追跡されていないファイルをクリーンアップします)。

于 2017-09-08T06:18:58.887 に答える
0

https urlを使用してリモートマスターにプッシュすると、同じ問題が発生し、SSHアドレスに変更したところ、すべてが問題なく動作を再開しました。

于 2019-08-31T01:29:17.620 に答える
0

ファイル/etc/gitlab/gitlab.rbの次の行nginx['client_max_body_size']='Xm'のサイズを増やすことで、この問題を解決できました。

X=あなたの価値。デフォルト値は250です。

ファイルを更新した後、再構成コマンドgitlab-ctlreconfigureを実行します

于 2021-07-11T18:36:27.997 に答える