With the recent release of Git 2.26, the open source distributed version control system uses version 2 of Git’s network fetch protocol by default.
This protocol, introduced in 2018, addresses a problem with the old protocol, whereby a server would immediately list all of the branches, tags, and other references in the repository before the client could send anything. Use of the old protocol could mean sending megabytes of extra data for some repositories, even when the client only wanted to know about the master branch.
Git’s new network fetch protocol begins with the client requests and offers a way for the client to tell the server which reference it wants, making fetches from large repos much faster.
Other capabilities in Git 2.26, which can be downloaded from the project website, include:
- New config options, including the ability to use wildcards when matching credential URLs. Git config options can be set for all connections or only connections to specific URLs.
- Updates to sparse-checkouts, which provide a way to have only part of a repository checked out at a time. A
git-sparse-checkout addmode allows for adding new directory entries one at a time.
git greprepo search capability is now faster.
This story, “Git 2.26 fetches faster by default” was originally published by