Just wanted to know whether github server supports git wire protocol-v2? - https://opensource.googleblog.com/2018/05/introducing-git-protocol-version-2.html - https://github.com/git/git/blob/master/Documentation/technical/protocol-v2.txt
Not yet Yes since Nov. 2018 (see the last section below).
I have presented the protocol v2 in "How does Git's transfer protocol work", introduced in commit 9bfa0f9.
But this new implementation only dates from Git 2.18, released in July 2018.
It was too soon yet for GitHub to support it at the time of the OP's question.
You can check that with:
# 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"
A v2 server would reply:
S: 200 OK
S: <Some headers>
S: ...
S:
S: 000eversion 2\n
S: <capability-advertisement>
In July, I saw:
< 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
No 000eversion 2\n
yet.
Note: (July 2018), the direction page of GitLab clearly mentions a "Support Git protocol version 2" for GitLab 11.2 (Aug. 22nd, 2018): see issue 46555.
In order for GitLab servers to start answering with the v2 protocol we need to do a few things:
- (required) install Git 2.18 on Gitaly servers in gitlab-omnibus
- (required) propagate the
Git-Protocol
HTTP header in workhorse -> gitaly -> git: seegitlab-org/gitaly-proto
merge request 208- (required) propagate the
Git-Protocol
environment variable in sshd -> gitlab-shell -> gitaly -> git- (optional) gate the v2 advertisement with a feature flag so that we can stop it from reaching gitaly. That way we would be in control of whether the v2 protocol is active or not.
Who will be first?
... From this comment, GitLab might be first (Nov 2018, for GitLab 11.4)
it looks like we're the first big Git host to support this! We should be sure to mention that in the release blog post, if we verify it is indeed the case :)
But only HTTPS for now, not yet SSH (issue 46555)
Git v2 over SSH won't be enabled by default either (requires SSHD changes, which we'll need to document).
Issue 5244 confirms:
I can see that this is working via HTTP on GitLab.com π
# 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
Documentation should follow (gitlab-org/gitlab-ce
merge-request 22227)
... GitLab is however narrowly late to GitHub:
Nov. 8th: "Git Wire Protocol v2 Support on GitHub":
GitHub now supports version 2 of the Git wire protocol.
An immediate benefit of the new protocol is that it enables reference filtering on the server-side, this can reduce the number of bytes required to fulfill operations like **git fetch on large repositories**. (source, source, source, β¦)
To utilize the new protocol, your git client must be at or beyond version 2.18, released June 2018 and the protocol version must be specified in your git client configuration:
git config --global protocol.version 2
See "Documentation/technical/protocol-v2.txt
" for more.
[protocol.version]
(git-scm.com/docs/git-config#git-config-protocolversion) with information regarding the new wire protocol. β
Angulation It happened :)
© 2022 - 2024 β McMap. All rights reserved.