最近修改專案並新增許多 packages。加入 Git 清單後,Push 時出現以下錯誤:
TortoiseGit 顯示的錯誤與標題相同。
Enumerating objects: 490, done.
Counting objects: 100% (381/381), done.
Delta compression using up to 12 threads
Compressing objects: 100% (288/288), done.
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
fatal: the remote end hung up unexpectedly
Writing objects: 100% (299/299), 7.85 MiB | 8.89 MiB/s, done.
Total 299 (delta 133), reused 16 (delta 1), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
| 錯誤訊息 | 說明 |
|---|---|
Enumerating objects, Counting objects, Compressing objects, Writing objects | Git 正在打包、壓縮並準備送出,這部分正常。 |
error: RPC failed; HTTP 400 curl 22 | Git client 使用 HTTP POST 傳送資料,但遠端 server 回傳 HTTP 400(Bad Request)。 |
fatal: the remote end hung up unexpectedly | Server 端中途斷線,可能與資料包大小、逾時或伺服器不接受格式有關。 |
其中一個處理方式是把提交緩衝區調整為 5GB;這項設定會套用到所有 Git 專案。
git config --global http.postBuffer 5242880000
參考資料:
git 推送出现 “fatal: The remote end hung up unexpectedly” 解决方案 - DomAndBom - 博客园
git 推送出现 ‘fatal: The remote end hung up unexpectedly’ 解决方案

