还没是的,自2018年11月以来(见下文最后一节).
我在提交9bfa0f9中介绍了" Git的传输协议如何工作 "中提出的协议v2 .
但是这个新的实现只能发布于2018年7月发布的Git 2.18.GitHub在
提出问题时尚未提供支持.
您可以通过以下方式检查:
# Linux
GIT_CURL_VERBOSE=2 git -c protocol.version=2 ls-remote --heads https://github.com/bower/bower.git
# Windows:
cmd /v /c "set GIT_CURL_VERBOSE=2&& git -c protocol.version=2 ls-remote --heads https://github.com/bower/bower.git"
Run Code Online (Sandbox Code Playgroud)
v2服务器会回复:
S: 200 OK
S: <Some headers>
S: ...
S:
S: 000eversion 2\n
S: <capability-advertisement>
Run Code Online (Sandbox Code Playgroud)
七月,我看到:
< HTTP/1.1 200 OK
< Server: GitHub Babel 2.0
< Content-Type: application/x-git-upload-pack-advertisement
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< X-GitHub-Request-Id: F361:7598:2BF8FEF:518E5FB:5B541C22
< X-Frame-Options: DENY
Run Code Online (Sandbox Code Playgroud)
没有000eversion 2\n呢.
注意:(2018年7月),GitLab的方向页明确提到了GitLab 11.2(2018年8月22日)的"支持Git协议版本2":见问题46555.
为了让GitLab服务器开始使用v2协议进行应答,我们需要做一些事情:
- (必需)在gitlab-omnibus的Gitaly服务器上安装Git 2.18
- (必需)
Git-Protocol在workhorse中传播HTTP头 - > gitaly - > git:参见gitlab-org/gitaly-proto合并请求208- (必需)
Git-Protocol在sshd - > gitlab-shell - > gitaly - > git中传播环境变量- (可选)使用功能标志来阻止v2广告,以便我们可以阻止它到达gitaly.这样我们就可以控制v2协议是否有效.
谁将是谁?
...... 根据这条评论,GitLab可能是第一个(2018年11月,GitLab 11.4)
看起来我们是第一个支持这个的大Git主机!我们一定要提一下,在发布博客文章中,如果我们确认确实如此:)
但是现在只有HTTPS,还没有SSH(问题46555)
默认情况下,也不会启用SSH上的Git v2(需要SSHD更改,我们需要对其进行记录).
问题5244证实:
我可以看到这是通过GitLab.com上的HTTP工作的
# Original Git wire protocol
GIT_TRACE_PACKET=1 git -c protocol.version=0 ls-remote https://gitlab.com/gitlab-org/gitlab-ce.git master
# New Git wire protocol v2
GIT_TRACE_PACKET=1 git -c protocol.version=2 ls-remote https://gitlab.com/gitlab-org/gitlab-ce.git master
Run Code Online (Sandbox Code Playgroud)
文档应遵循(gitlab-org/gitlab-cemerge-request 22227)
...然而GitLab对GitHub来说已经很晚了:
11月8日:" GitHub上的Git Wire Protocol v2支持 ":
GitHub现在支持Git线协议的第2版.
新协议的一个直接好处是它可以在服务器端启用参考过滤,这可以减少完成大型存储库**上的**git fetch等操作所需的字节数.(源,源,源,...)
要使用新协议,您的git客户端必须达到或超过2018年6月发布的版本2.18,并且必须在您的git客户端配置中指定协议版本:
Run Code Online (Sandbox Code Playgroud)git config --global protocol.version 2
请参阅" Documentation/technical/protocol-v2.txt"了解更多信息.
| 归档时间: |
|
| 查看次数: |
755 次 |
| 最近记录: |