How to respond to git clone command using NGIT

613 views Asked by At

Using NGit (or even JGit since it's a port) does anyone know how to respond to the Git clone command over Smart HTTP? What would the sample code look like?

I can't find any references or documentation which describes this.

I'm trying to create a .NET GIT server to handle simple clone, push and pull requests.

Any help is appreciated.

2

There are 2 answers

0
Kevin Sawicki On

You should be able to use the org.eclipse.jgit.http.server.GitServlet to handle fetch and push requests over Smart HTTP.

The specific servlet that handles Smart fetch is the UploadPackServlet.

There is a SimpleHttpServer class which is an example Smart HTTP enabled server in the org.eclipse.jgit.junit.http project.

0
linquize On

See my fork of GitAspx at https://github.com/linquize/git-dot-aspx

Recently it supports NGit as backend, as the original GitSharp is out of date and buggy Make sure you host it in IIS. Development server does not support http 1.1