Git Server Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID git-server Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Feb 10, 2014
git (version:2.0.1)
Source Code
Issue Tracking
Open Issues
n/a (id: jglick)
Usage Installations 2013-Apr 2092
2013-May 2315
2013-Jun 2482
2013-Jul 2766
2013-Aug 2953
2013-Sep 3114
2013-Oct 3445
2013-Nov 3454
2013-Dec 3474
2014-Jan 3805
2014-Feb 4066
2014-Mar 4309

This plugin wraps the server-side functionality of JGit so that other plugins can easily expose Git repositories from Jenkins via its SSH transport and HTTP in a collaborative fashion. This plugin is a library plugin, in the sense that it doesn't have any user visible feature on its own.

See Git userContent plugin as a nice and short example of how to take advantages of this feature.

Developer Guide

In terms of code, there are two classes that plugins like git-userContent-plugin should be interested in.

One is HttpGitRepository, which represents Git repository access via HTTP. Typically you have some directory inside $JENKINS_HOME that houses the repository, then you subtype GitHttpRepository and override abstract methods to fill in the missing details. FileBackedHttpGitRepository is a convenient default implementation that simplifies this further. GitUserContentRepository in git-userContent-plugin is an example of using this class. This use also implements RootAction to bind this repository at http://server/jenkins/userContent.git, and I expect this combination to be fairly common.

The other class of interest is RepositoryResolver. Git server plugin adds necessary Jenkins SSH CLI hook for exposing Git repositories over SSH. The only missing link here is that when the client runs "git clone ssh://server/foo/bar/zot.git", we need to figure out what repositories on the server corresponds to /foo/bar/zot.git, and that's what the RepositoryResolver extension point does. The sample implementation in git-userContent-plugin will be hopefully self-explanatory. In this case, GitUserContentRepository is a singleton (because it's RootAction), so we inject that and basically just delegate the calls to it.


1.3 (Feb 10 2014)

  • Another JGit incompatibility with Git Client (issue #21163)

1.2 (Aug 09 2013)

  • JGit incompatibility with new Git Client plugin (issue #18973)


plugin-library plugin-library Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.