状況
git push -u origin master
commitしたfileをpushする際に
Total 15 (delta 0), reused 0 (delta 0), pack-resued 0
上記の表示のまま止まりpushが完了しない。
ファイル構成
.
├── css
│ └── style.css
│
├── img
│ ├─ img1.png
│ ├─ img2.png
│ ├─ img3.png
│ ├─ img4.png
│ ├─ img5.png
│ └─ logo.png
│
└── index.html
試したこと
-
git gc
コマンド - Github Desktopを使う
- VS Codeの拡張機能を使う
解決策
git config --global http.postBuffer 157286400
git config http.postBuffer 157286400
追記
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 を行う際に起こる問題を解決できるがメモリの消費が増加する。
git config --show-origin --get-all http.postBuffer
git config --global --unset http.postBuffer
git config --local --unset http.postBuffer