To understand more about git, I try to write a very simple Git server using Python and Flask. I registered an endpoint and redirect the calls to git-http-backend. So far a simple pull works fine. Also simple/small pushes go through.
Now I stumbled over git-upload-pack and git-receive-pack, and I am wondering why or when I would need them? Are they used by git-http-backend in the background? I am not sure if I additionally have to support these commands too.
P.S. I try to wrap my head around SmartHTTP. Does it mean Full-Duplex? Or what is meant to be SmartHTTP vs Dumb? I don't exactly understand what is supposed to be smart if it also just receives and sends/pushes a file?
I presented the smart http protocol in 2011 with Git 1.6.6.
But
git-receive-packandgit-upload-packwould be involve even without HTTP, with for instance SSH URL.I have to know about them because I often install Git on servers where I am not root.
That means the executable
gitis not in/usr/bin, but in/my/path/to/git/usr/binAnd whenever I do a
git cloneon my PC from that server (or agit ls-remote), I get:If I try a
git pushfrom my PC to that server:That is because, when you look at the
usr/binfolder of a Git installation, you would see:Meaning
git-receive-packandgit-upload-packare just symlink togititself(!)But, because of their naming convention (
git-xxx), they are actually callinggitwith the commandreceive-packorupload-pack.(incidently, that works for any script
git-xxxin your$PATH: you can then typegit xxx, that will call yourgit-xxxscript)For my custom Git installation to work, I had to implement
git-xxxwrappers:Example:
With setenv setting the right PATH:
And on the client (PC) side, I need, for a remote using the server with custom Git installation, to add: