GitLab added support for Git Protocol v2 over HTTP and SSH in GitLab 11.4, and enabled Protocol v2 over HTTP on GitLab.com, but not for SSH. On Nov. 23, we enabled Git Protocol v2 over SSH on GitLab.com. You can view Git Protocol usage on our public dashboard.
Git Protocol v2 is supported from Git v2.18.0 and is opt-in. To enable globally, run
git config --global protocol.version 2.
What Git Protocol v2 means for you
Git 2.18 introduced support for Protocol v2, which defines how clones, fetches, and pushes are communicated between the client (your computer) and the server (GitLab). The new wire protocol improves the performance of fetch commands and enables future protocol improvements. Read more about Protocol v2 in the release post by the author of the change.
To see the reduction in network traffic with Protocol v2 you can run the commands below:
# Original Git wire protocol GIT_TRACE_PACKET=1 git -c protocol.version=0 ls-remote firstname.lastname@example.org:gitlab-org/gitlab-ce.git master # New Git wire protocol v2 GIT_TRACE_PACKET=1 git -c protocol.version=2 ls-remote email@example.com:gitlab-org/gitlab-ce.git master
In moving from Protocol v0 to v2, on this repo the number of lines ("packets") sent behind the scenes drops from over 36,000 to fewer than 30.