使用 git 推送时出错 "bad line length 8192iB"

Error "bad line length 8192iB" when use git push

我使用 Visual Studio Team Services 和 git 来存储我的源代码。

我的游戏文件很大。 我将我的游戏代码保存在 Visual Studio Team Services 中并且没有收到错误。但是最近,我添加了更多的大文件,问题开始出现。

当我使用 git 推送时,我收到以下错误:

F:\Games\BarbarianSouls_v2>git push
Counting objects: 19464, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (19457/19457), done.
fatal: protocol error: bad line length 8192iB | 3.24 MiB/s
fatal: sha1 file '<stdout>' write error: Broken pipe
error: failed to push some refs to 'https://gitlab.com/fabiobh/barbarian_souls.git'

项目超过 10GB,我不知道这是否会影响存储库,根据 Microsoft 的说法,VSTS 存储库没有大小限制。

我尝试使用下面的代码

git config --global http.postBuffer 524288000

但是还是不行,显示492mb的时候上传就停止了,于是我尝试用下面的代码:

git config --global http.postBuffer 7242880000

但是我得到了第一个错误:

fatal: protocol error: bad line length 8192iB

我怎样才能摆脱这个错误?

如果您的推送包含多个提交,您可以尝试以较小的批次推送提交,而不是包含所有提交的大推送。当我得到这个时为我工作

fatal: protocol error: bad line length 8192

留言。示例:

git push origin <commit hash>:master