Dec 10, 2018 - James Ramsay    

Git Protocol v2 now enabled for SSH on GitLab.com

Fetch faster using Git Protocol v2 – here's how.

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 git@gitlab.com:gitlab-org/gitlab-ce.git master

# New Git wire protocol v2
GIT_TRACE_PACKET=1 git -c protocol.version=2 ls-remote git@gitlab.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.

Install GitLab in 2 minutes

With Ubuntu, Debian, CentOS, openSUSE, and Raspbian packages or from source

Install GitLab Now

Try GitLab risk-free for 30 days.

No credit card required. Have questions? Contact us.