git 推 returns "unknown value given to http.version: 'HTTP/1.1."

git push returns "unknown value given to http.version: 'HTTP/1.1."

我的 github 仓库在推送时开始给我这个错误:

给 http.version 的未知值:'HTTP/1.1.'

这是完整的日志:

 % git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
% git push
warning: unknown value given to http.version: 'HTTP/1.1.'
batch response: Unknown HTTP version "HTTP/1.1."                                                          
Uploading LFS objects:   0% (0/7), 0 B | 0 B/s, done.
error: failed to push some refs to 'https://github.com/blabla/unity-blabla.git'

我该如何解决?

打开 gitconfig 文件(~/.gitconfig 在基于 Unix 的系统上,C:\ProgramData\Git\config 在 Windows 上),然后手动编辑包含 HTTP 版本的行(即删除它) .

或者,您可以键入以下命令:

git config --global --unset http.version