InstaGit is an instant Git server based on JGit and Jetty.
It provides HTTP access to existing Git repositories in the local filesystem.
You can publish your repositories and fetch them over the network.
Download the release and run. It requires Java 6 or later.
curl -LO https://github.com/int128/instagit/releases/download/latest/instagit.jar
java -jar instagit.jar
InstaGit is available on Docker Hub. Run a container as follows.
docker run --rm -p 8080:8080 -v /repos:/repos int128/instagit
The server provides access to repositories in the current directory at default.
For example, if the current directory has children as follows,
.
(currrent directory)./repo1
(directory of Git repository)./repo2
(directory of Git repository)
run following commands to clone them:
git clone http://localhost:8080/repo1
git clone http://localhost:8080/repo2
Following URLs will serve the list of repositories.
- Open
http://localhost:8080/
to see a Web page. - Open
http://localhost:8080/?json
to get a JSON.
It accepts following options:
-b host
- listening host; default is-b 0.0.0.0
(all interfaces)-p port
- listening port; default is-p 8080
-l
- listening on localhost- Extra argument - a base path of repositories; default is
.
(current directory)
Example:
java -jar instagit.jar -l ..
The server provides read-only access without any authentication. It does not provide write access currently.
InstaGit is available on Maven Central and Bintray.
// Gradle
compile 'org.hidetake:instagit:x.y'
Create and start a server by calling GitServer.create()
method.
import org.eclipse.jetty.server.Server;
import org.hidetake.gitserver.GitServer;
import java.net.InetSocketAddress;
Server server = GitServer.create(new InetSocketAddress(8080), ".");
server.start();
server.stop();
See Main
class for example.
Product code is written in Java 6. It uses Jetty server and JGit servlet.
Test code is written in Groovy and Spock.
This is an open source software licensed under the Apache License Version 2.0. Send me your issue or pull request.