首页 > 解决方案 > GIT LFS(仅支持 application/vnd.git-lfs 和 application/vnd.git-lfs+json)

问题描述

LFS 支持已经在我们的 Azure GIT 存储库中工作了很长时间,但是在推送带有大文件的提交时它突然失败了。它开始上传。看起来它重新启动了几次,然后失败了。

C:\Git\...>git push
Locking support detected on remote "origin". Consider enabling it with:
  $ git config lfs.https://...@dev.azure.com/.../.../_git/....git/info/lfs.locksverify true
LFS: Client error: https://...@dev.azure.com/.../.../_git/.../info/lfs/objects/... from HTTP 413
Uploading LFS objects:   0% (0/1), 0 B | 18 MB/s, done.
error: failed to push some refs to 'https://dev.azure.com/.../.../_git/...'

客户端错误是:仅支持 application/vnd.git-lfs 和 application/vnd.git-lfs+json

使用:

更新 问题是一致的。添加新文件会产生相同的错误。我已经重新安装了 GIT/GIT-LFS,并清理了 GIT repo 文件夹。没变。

标签: gitgit-lfs

解决方案


在调查时偶然发现了这个https://developercommunity.visualstudio.com/t/git-lfs-push-got-413-error/867488 。调用下面的命令解决了我的问题。

git config http.version HTTP/1.1

推荐阅读