6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GithubにPushをしたが終わらない時の対処方法

Last updated at Posted at 2023-01-12

状況

git push -u origin master

commitしたfileをpushする際に

Total 15 (delta 0), reused 0 (delta 0), pack-resued 0

上記の表示のまま止まりpushが完了しない。

ファイル構成

ecsite
.
├── css
│   └── style.css
│
├── img
│    ├─ img1.png
│    ├─ img2.png
│    ├─ img3.png
│    ├─ img4.png
│    ├─ img5.png
│    └─ logo.png
│
└── index.html

試したこと

  1. git gcコマンド
  2. Github Desktopを使う
  3. VS Codeの拡張機能を使う

解決策

globalな設定
git config --global http.postBuffer 157286400
localな設定
git config http.postBuffer 157286400

引用した解決策 Stack Overflow

追記

git-configのドキュメントを参照すると

Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

Note that raising this limit is only effective for disabling chunked transfer encoding and therefore should be used only where the remote server or a proxy only supports HTTP/1.0 or is noncompliant with the HTTP standard. Raising this is not, in general, an effective solution for most push problems, but can increase memory consumption significantly since the entire buffer is allocated even for small pushes.

デフォルトは 1MiB で設定されていて http.postBuffer の値を上げる事で大抵の push を行う際に起こる問題を解決できるがメモリの消費が増加する。


http.postBufferが設定されているか確認するコマンド
git config --show-origin --get-all http.postBuffer
globalで解除する方法
git config --global --unset http.postBuffer
localで解除する方法
git config --local --unset http.postBuffer

参照したサイト

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?