I'm playing around with git's transfer protocols, and I was just wondering if there is some detailed specification for them before I attempt to read the source?
Git can transfer data between two repositories in two major ways: the “dumb” protocol and the “smart” protocol. This section will quickly cover how these two main protocols operate.
In Git, locations in the form of [user@]server:path are interpreted as SSH addresses (and the 'clone' tool literally runs ssh [user@]server in the background). By default, SSH connects to port 22/tcp, which is the standard SSH port.
The default on both GitHub.com (the website) and in GitHub CLI is using the HTTPS protocol for git operations. This default was chosen for interoperability and ease of use: Git users who are behind firewalls find that traffic to port 443 (HTTPS) is more often allowed than traffic to port 22 (SSH).
Update May 2018: Starting Q2 2018 and Git 2.18, you will have the Git transfer protocol v2: See "How does Git's transfer protocol work".
Original answer 2013:
First, check the git documentation in the git repo itself (with a good grep, available even on Windows):
git clone https://github.com/git/git
cd git/Documentation
grep -nRHI "receive-pack" *
That will give you pointers to:
send-pack
pipelineThen you can complete that set of documentation with ones related to the backend commands:
git-http-backend
git-receive-pack
git-remote-ext
git-send-pack
gitremote-helpers
One way at looking at the source is by looking at the recent evolutions around transfer and transport in the git repo:
git clone https://github.com/git/git
cd git
git log -Stransfer
Have a look at:
Another way is to have a look at other implementation of git:
Transport.java
source (tested in TransportTest.java
, which declines into:
C, with libgit2, and its src/transports
sources.
... and so on
there is also a partially completed documentation hosted on Github Gist.
This metasploit module also poses as a malicious dumb git server, serving bad git trees. You can see how the git trees are constructed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With