Protocols
Saved & recent

Git wire protocols

Also called: Git protocol v2, Git smart protocol, fetch negotiation

Git wire protocols let a client and server exchange repository information and objects. They are distinct from Git’s local object storage and can be carried over transports such as SSH or HTTP. Protocol version 2 organizes supported fetch-side operations as commands with advertised capabilities.

During a fetch, a client can discover references and negotiate which objects it needs using what it already has. The server sends the required object data in a packfile. This saves sending every object on each update. Version negotiation and packet-line framing govern the conversation; a successful network transfer alone does not decide how branches should be merged locally.

Related
Message framing, Version negotiation, HTTP
Further reading
Git — Protocol version 2
A B A B C D local objects remote objects discover capabilities ls-refs request refs reply fetch · wants and haves pack · needed C and D Git v2 fetch · simplified object sets
A simplified v2 fetch negotiates needed objects. Transfer and local branch integration are separate operations.

View in the full Protocols collection