0

I want to create a standalone git server which could be used by git with git:// urls.

I don't know where to start. LibGit2 does not seem to contain libraries for the daemon, only for clients. I could try to compile git and check the daemon but, if possible, I want to avoid that until I have no other option.

Where do I find a protocol description?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Michael Chourdakis
  • 10,345
  • 3
  • 42
  • 78
  • Have you Tried the following: http://stackoverflow.com/questions/978052/how-can-i-make-my-local-repository-available-for-git-pull http://review.cyanogenmod.org/Documentation/install.html – Roy Doron Dec 13 '15 at 10:01

1 Answers1

3

The description of that protocol supported by git daemon is in git/git/Documentation/git-daemon.txt.
That documentation also include how to use it.

let's see an example:

$ git daemon --reuseaddr --verbose --base-path=/home/gitte/git \
  --export-all -- /home/gitte/git/rule-the-world.git

(Of course, unless your user name is gitte and your repository is in ~/rule-the-world.git, you have to adjust the paths. If your repository is not bare, be aware that you have to type the path to the .git directory!)

See also Git on the Server - Git Daemon and git:// protocol.

For even more details, see this exercise reimplementing the git protocol:

http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/images/git-clone-overview@2x.png

http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/images/pack-client-server.png

That new implementation is in Haskell, but can give you an idea of the steps to follow in order to implement your own in your own language.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250