A simple git interface for NodeJS. It is not intended to replace projects such as nodegit but rather to provide a light weight solution close to the git command line for simple use cases.
Installation
Just run
$ npm install git-cli
Usage
The usage is pretty straightforward, here is a sample code.
Repository = require'git-cli'Repositoryfs = require 'fs' Repositoryclone 'https://github.com/tuvistavie/node-git-cli''git-cli' repolog consolelog logs0subject reposhowRemote 'origin' consolelog remotefetchUrl fswriteFileSync "/newFile"'foobar' repostatus consolelog status0path consolelog status0tracked repoadd repostatus consolelog status0path consolelog status0tracked repocommit 'added newFile' repolog consolelog logs0subject repopush consolelog 'pushed to remote'
From version 0.10, all functions still take a callback, but also return promises, so you can rewrite the above as follow:
const Repository = Repositoryconst fs = Repository
Checkout out the tests for more examples.