Senior LevelGit & GitHub
How does Git Wire Protocol v2 optimize fetch negotiation and reference advertisement?
❓ Interview Prompt: Explain Git Wire Protocol v1 vs v2 (git config protocol.version=2), ref filtering, capability negotiation, and server fetch optimization.
Git Wire Protocol v2 allows clients to request specific ref prefixes (ls-refs), eliminating the need for servers to advertise all repository refs and reducing fetch network overhead by 95%.
Code Implementation Example
bash
git config --global protocol.version 2💡Enabling Git Wire Protocol v2 for optimized fetch ref advertisement.
🎯 Interview Key Takeaway
Git Wire Protocol v2 allows clients to request specific ref prefixes, eliminating massive ref advertisement overhead on fetches.
#Protocol v2#Wire Protocol#Network#Senior
Back to all Git & GitHub Questions→