Nicolas Raoul
Nicolas Raoul

Reputation: 60203

Any server implementing the Git protocol, apart from Git itself?

I have a content repository server software, clients are able to list/read/edit their files using their favorite protocol: FTP/WebDAV/CIFS/...

I am wondering whether implementing a Git interface would make sense (I would implement the server-side of the Git protocol, and Git clients would connect to it).

QUESTION: Is there any server-side software that implements the Git protocol? (except the Git server developed by Torvalds) ?

Upvotes: 1

Views: 374

Answers (1)

djs
djs

Reputation: 4776

You almost certainly do not want to implement a git server yourself. Git's design does not lend itself to lib-ization, so it's been an ongoing problem that a first-class library version of git has not been available.

Nonetheless, there are a number of options, depends on your needs:

  1. libgit2, the most recent work on a true C git library, and its various bindings to other languages
  2. GitPython, and similar libraries for Python and other languages which wrap the git executable itself
  3. jgit, a native Java implementation of git

If what you want to do is provide a transparent git-like interface to your content, you'll need to consider carefully what that means and what you want to provide. Git is a DVCS, and so it keeps the entire history of everything. That means that you have to keep and serve the entire history in order for folks to do anything useful with your repository. So, if you're just trying to export data for a one-time view, this doesn't make a lot of sense. I think this approach would make the most sense only if you're actually keeping all of the backend data stored under version control in git.

Finally, note that there is no 'git server' per se. Git utilizes existing transports like ssh, http, etc that can send simple git commands in order to send and retrieve data.

Upvotes: 2

Related Questions