instagit

instant Git HTTP server

License

License

Categories

Categories

IDE Development Tools
GroupId

GroupId

org.hidetake
ArtifactId

ArtifactId

instagit
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

instagit
instant Git HTTP server
Project URL

Project URL

https://github.com/int128/instagit
Source Code Management

Source Code Management

https://github.com/int128/instagit.git

Download instagit

How to add to project

<!-- https://jarcasting.com/artifacts/org.hidetake/instagit/ -->
<dependency>
    <groupId>org.hidetake</groupId>
    <artifactId>instagit</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.hidetake/instagit/
implementation 'org.hidetake:instagit:1.0'
// https://jarcasting.com/artifacts/org.hidetake/instagit/
implementation ("org.hidetake:instagit:1.0")
'org.hidetake:instagit:jar:1.0'
<dependency org="org.hidetake" name="instagit" rev="1.0">
  <artifact name="instagit" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.hidetake', module='instagit', version='1.0')
)
libraryDependencies += "org.hidetake" % "instagit" % "1.0"
[org.hidetake/instagit "1.0"]

Dependencies

runtime (3)

Group / Artifact Type Version
org.eclipse.jetty : jetty-servlet jar 9.2.6.v20141205
org.eclipse.jgit : org.eclipse.jgit.http.server jar 3.6.0.201412230720-r
args4j : args4j jar 2.0.29

Project Modules

There are no modules declared in this project.

InstaGit Build Status

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.

How to Use

Run the server

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

Try Git access

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.

Options

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 ..

Caveat

The server provides read-only access without any authentication. It does not provide write access currently.

How to Use in your App

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.

Architecture

Product code is written in Java 6. It uses Jetty server and JGit servlet.

Test code is written in Groovy and Spock.

Contribution

This is an open source software licensed under the Apache License Version 2.0. Send me your issue or pull request.

Versions

Version
1.0