a javascript wrapper for the git cli
JavaScript
Latest commit ab8e09f Feb 19, 2017 @bookchin update badge
Permalink
Failed to load latest commit information.
lib
script
test Pass optional options to Repository constructor Feb 17, 2017
.gitignore update documentation and setup gh-pages Mar 1, 2016
.jsdoc.json update documentation and setup gh-pages Mar 1, 2016
.travis.yml tell travis to use latest node version Feb 25, 2015
CONTRIBUTING.md Passing Repository to Command to allow Command to access path and git… Dec 13, 2015
LICENSE
README.md
index.js
package.json Pass optional options to Repository constructor Feb 17, 2017

README.md

Gitty

Build Status

Gitty is a Node.js wrapper for Git. It's syntax resembles the Git command line syntax, executes common commands, and parses the output into operable objects.

Complete documentation is available here.

Installation

Prerequisites

$ npm install gitty

Testing

Run the the unit and integration tests with:

$ npm test

Usage

var git    = require('gitty');

// identifying the repo and using defaults
var myRepo = git('/path/to/repo');

// explicitly passing the path to the git client
var myRepo2 = git('/path/to/repo2', '/not-in-path/bin/git');

// specifying an options object (note all properties are optional)
var myRepo3 = git('/path/to/repo3', {
  gitpath: '/not-in-path/bin/git',                          // optional
  largeOperations: ['log', 'ls-files', 'status', 'commit'], // optional
  largeOperationsMaxBuffer: 1024 * 6000                     // optional
});

Now you can call this instance of Repository's methods. For example, to execute git log for myRepo, you would do:

myRepo.log(function(err, log) {
	if (err) return console.log('Error:', err);
	// ...
});

Authenticated Repositories

Gitty no longer supports username/password authentication over SSH. You should be using SSH keys for that.

myRepo.push('origin', 'master', function(err, succ) {
	if (err) return console.log(err);
	// ...
});

Author

Gitty was written by Gordon Hall (gordon@gordonwritescode.com)
Licensed under LGPLv3 license