Skip to content

datudou/node-git-rest-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GIT REST API

Build Status

The aim of the project is to provide a restful Git API that mimics as most as possible the old good git.

For example, in order to commit a change in shell you should do:

$ mkdir new-project
$ cd new-project
$ git init
$ git add file.c
$ git commit -m 'A commit message'
$ git add file.c
$ git commit -m 'A second commit message'
$ git show HEAD~:file.c

In case of git-rest-api you should do:

POST /init
  { "repo": "new-project" }
POST /repo/new-project/tree/file.c
POST /repo/new-project/commit
  { "message": "A commit message" }
POST /repo/new-project/tree/file.c
POST /repo/new-project/commit
  { "message": "A second commit message" }
GET  /repo/new-project/show/file.c?rev=HEAD~

Install

In your project install git-rest-api and express:

$ npm install git-rest-api
$ npm install express

A simple example of a server running git-rest-api:

var app = require('express')(),
    git = require('git-rest-api');

git.init(app, { installMiddleware: true }).then(function () {
  app.listen(8080);
  console.log('Listening on', 8080);
});

Examples

API

About

A restful Git API mimicking as most as possible the old good git

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 97.4%
  • Puppet 1.7%
  • Makefile 0.9%