使用 git clone 新项目时报错:
error: RPC failed; curl 56 HTTP/2 stream 7 was reset
fatal: expected 'packfile'
分析错误
RPC: 是 Remote Procedure Call 缩写, 意思是远程过程调用
curl: 命令行工具, 用来请求 web 服务器的. 客户端(client) 的 url 的意思
错误的大概意思是远程过程调用失败, 具体是 curl 连接被重置了
解决问题
- 打开 github, 找到 git-for-windows 的仓库
- 在 issue 中搜索
RPC failed; curl 56 HTTP/2 stream 7 was reset - 点开意思相近的一个 issue: github.com/git-for-win…
- 其中有一条连接到 curl 的仓库 issue: github.com/curl/curl/i…
然后找到两个解决办法:
- 不使用 HTTP2, 改用 HTTP1
- 降低 git 的版本, 目前使用的是
2.41.0
这里使用第二种, 直接降低 git 版本为 2.41 之下的问题就解决了