Search code examples
javagitweb-applicationsgitosisjgit

How to write or package a Git server as a Java Servlet or Java webapp?


Git is clearly awesome and a variety of clients are both available and easy to install for all platforms.

However it's a bit of a challenge to get a Git server up and running for teams.

I'm a bit surprised that there is not yet an easily deploy-able Java-Git app server or webapp. It looks like Gitosis, Gitolite, etc. are some options running on other stacks, but if you’re already running a Java stack it would be easiest to just deploy a Java servlet or webapp.

Along these lines I was wondering how one would approach writing a Java ‘Git Server’ webapp?

How far could JGit get you for a simple implementation? What would one need to do to package JGit as a web app to be able to push/pull to it and from it as well as easily create new repos?


Solution

  • Gerritt is deployable as a war file and uses JGit to provide the git server functionality. In addition to the standard git server functionality, is also supports access control and code review.