๐ฌ ์ํฉ ์ค๋ช
์ต์๋์ธ์์ ๊ธ์ ์ ๋ฆฌํ๋ค๊ฐ ์ด๋ฏธ์ง์ ํ์ผ์ด ๋๋ฌด ๋์กํ๊ฒ ์์ด์ ์น ์ ๋ฆฌ๋ฅผ ํ ๋ค์, push๋ฅผ ํ๋ ค๊ณ ํ๋๋ฐ, ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค.
> git push origin master
์ค๋ธ์ ํธ ๋์ดํ๋ ์ค: 205, ์๋ฃ.
์ค๋ธ์ ํธ ๊ฐ์ ์ธ๋ ์ค: 100% (205/205), ์๋ฃ.
Delta compression using up to 8 threads
์ค๋ธ์ ํธ ์์ถํ๋ ์ค: 100% (197/197), ์๋ฃ.
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
send-pack: unexpected disconnect while reading sideband packet
์ค๋ธ์ ํธ ์ฐ๋ ์ค: 100% (204/204), 2.36 MiB | 3.27 MiB/s, ์๋ฃ.
Total 204 (delta 5), reused 1 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
โ ํด๊ฒฐ ๊ณผ์
์ฐ์ ์๋ฌ ๋ก๊ทธ๋ฅผ ์ดํด๋ณด๋, HTTP ์์ฒญ์ ๋ณด๋๋๋ฐ, ์๋ต์ด 400 ์๋ฌ๊ฐ ๋ฐ์ํ ๊ฒ์ผ๋ก ๋ณด์ธ๋ค. ํน์๋ ์ถ์ด์, ๊น ๊ณต์ ๋ฌธ์์์ ํ์ธํด๋ณด๋, ๋ค์๊ณผ ๊ฐ์ ๊ธ์ด ์์๋ค.
http.postBuffer
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.
push ์์ฒญํ ๋, HTTP POST ์์ฒญ์ ํ๊ฒ ๋๋๋ฐ, ์ด ๋, HTTP/1.1 ๋ฐฉ์์ ์ด์ฉํ์ฌ, ํฐ ๋ฐ์ดํฐ๋ฅผ ์์ ์กฐ๊ฐ(์ฒญํฌ) ๋จ์๋ก ๋๋์ด ์๋ฒ์ ์ ์กํ๋ค๊ณ ํ๋ค. ๋ ์ดํด๋ณด๋ฉด, Default is 1 MiB๋ผ๋ ๋ง์ ๋ณผ ์ ์๋๋ฐ, ๊ธฐ๋ณธ๊ฐ์ด 1MB๋ผ๋ ๊ฒ์ด๋ค.
๋ด๊ฐ ๋ณด๋ธ ์์ฒญ์ ํฌ๊ธฐ๋ 2.36MiB์ธ ๊ฒ์ ๋ณด๋ ์ฉ๋์ ์ด๊ณผํ๊ฒ ๋ ๊ฒ์ด๋ค. ๊ทธ๋ ๋ค๋ฉด '์ด ๋ฒํผ ์ ํ์ 1MB๊ฐ ์๋ ์ต๋๋ก ๋๋ ค์ ์ฌ๋ฆฌ๋ฉด ๋์ง ์์๊น?'๋ผ๋ ์๊ฐ์ ํ๊ฒ ๋์๊ณ , ๋ค์ ๋ช
๋ น์ด๋ฅผ ์คํํด postBuffer์ ์ ํ ํฌ๊ธฐ๋ฅผ ๋๋ ค์ฃผ์๋ค.
# 524288000Bytes == 500MB
git config --global http.postBuffer 524288000
524288000bytes ÷ 1024(KB) ÷ 1024(MB) = 500MB
์์ ํ, push๋ฅผ ๋ค์ ์๋ํ๋ ์ฑ๊ณต์ ์ผ๋ก ์ฌ๋ผ๊ฐ ๊ฒ์ ๋ณผ ์ ์์๋ค. ์ดํ, ๋จ์ ๊ธ์ด ๊ถ๊ธํด์ ์ฝ์ด๋ณด๋๊น ๋ค์๊ณผ ๊ฐ์ ๋ฌธ์ฅ์ด ๋์ ๋์๋ค.
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.
์ด ์ ํ์ ๋์ด๋ ๊ฒ์, HTTP/1.0๋ง ์ง์ํ๊ฑฐ๋ HTTP ํ์ค์ ์ค์ํ์ง ์๋ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํด์ผ ํ๋ค๊ณ ํ๋ค. ๋๋ ๋จ์ํ ๊นํ๋ธ์ ์ฌ๋ฆฌ๋ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ ๋ฌธ์ ๋ ๋์ง ์์์ง๋ง, ์ HTTP ํ์ค์ ์ค์ํ์ง ์๋ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํด์ผํ๋์ง ๊ถ๊ธํด์ ธ์ ์ฐพ์๋ณด์๋ค.
์์ ๋งํ๋ ๊ฒ๊ณผ ๊ฐ์ด HTTP/1.1์ ํฐ ๋ฐ์ดํฐ๋ฅผ ์์ ์กฐ๊ฐ์ธ ์ฒญํฌ ๋จ์๋ก ๋๋์ด ์๋ฒ์ ์ ์กํ์ง๋ง, ๋ฒํผ ํฌ๊ธฐ๋ฅผ ๋๋ฆฌ๊ฒ ๋๋ฉด, HTTP/1.1 ๋ฐฉ์์ ์ฌ์ฉํ๊ธด ํ์ง๋ง, ๊น ๋ด๋ถ์์ ์ฒญํฌ ์ ์ก ์ธ์ฝ๋ฉ ๋ฐฉ์์ ๋นํ์ฑํ ํ๋ค๊ณ ํ๋ค. ์ฆ, HTTP/1.1 ํ์ค์ ๋ง๋ ์ ์ก ๋ฐฉ์์ ์ฌ์ฉํ์ง ์๊ณ HTTP/1.0 ๋ฐฉ์์ ๋จ์ผ POST ์์ฒญ์ผ๋ก ๋ณด๋ด ํ์ค์ ์งํค์ง ๋ชปํ๊ฒ ๋๋ ๊ฒ์ด๋ค.
๐ค ํ๊ณ
์ด ํด๊ฒฐ ๋ฐฉ์์ ๊นํ๋ธ๋ฅผ ์ฌ์ฉํ๋ ์ ์ ์
์ฅ์์๋ ํฌ๊ฒ ๋ฌธ์ ๋์ง๋ ์์ ๊ฒ์ด๋ผ ์๊ฐํ์ง๋ง, ํ์ฌ์์ ๊น๋ฉ ์๋ฒ๋ฅผ ์ง์ ๋๊ณ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, ์ํ์ด ์์ ์๋ ์๊ฒ ๋ค๋ผ๋ ์๊ฐ์ด ๋ค์๋ค. ๋ํ, postBuffer๋ฅผ ๋๋ฆฌ๋ ๊ฒ์ ๋ง ๊ทธ๋๋ก ๋ฒํผ ํฌ๊ธฐ๋ฅผ ๋๋ฆฌ๋ ๊ฒ์ด๊ธฐ ๋๋ฌธ์, ๋ฉ๋ชจ๋ฆฌ์ ๋ถ๋ด์ ์ค ์๋ ์๋ค๊ณ ํ๋ค. ๋๋ถ๋ถ 1MiB ๋ฏธ๋ง์ ๋ฐ์ดํฐ๋ง ์ค๊ฐ๊ธฐ ๋๋ฌธ์, ์ด ๋ฐฉ์์ผ๋ก ํด๊ฒฐํ๋ค๋ฉด, ์ต๋ ํฌ๊ธฐ๋ฅผ ๋ค์ 1MiB๋ก ์์ ํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ๋ค!
git config --global http.postBuffer 1048576'Devlog > Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [Git] ์คํฌ๋ฆฝํธ ์ ์ฉ (0) | 2025.05.08 |
|---|---|
| [Git] cherry-pick์ ํตํด push๋ ์ปค๋ฐ ๋๋๋ฆฌ๊ธฐ (0) | 2025.01.13 |