No, you're correct when you're saying you can serve a git repository without have git installed on your server.
This is because everything that is needed to serve a git repository, is "stored" in the .git
directory.
But, to communicate with a server (e.g. do a clone
, push
, etc...), based on your repository address (refspec
) a certain transport will be used. And if you're using the ssh
or git
transport, the server side needs to have git installed as well. Because, like you said, it 'packs' all data that is exchanged in a more efficient format.
You could circumvent this by mounting remote server on your filesystem, and use the 'file' transport. Or you could upload your own 'alternatives' for git, and use that instead:
git clone -u /home/you/bin/git-upload-pack you@machine:code
(from: git-upload-pack: command not found, how to fix this correctly )