Git.status()

Get the current "working tree status" of a local git repo.

Usage

Hover over inputs/exits for more info.

var Git = require('machinepack-git');


// Get the current "working tree status" of a local git repo.

Git.status({

dir: './',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Specified directory is not a git repository (and neither are any of its parents)

notRepo: function () {

 

},

// Insufficient permissions (i.e. you might need to use `chown`/`chmod`)

forbidden: function () {

 

},

// Specified directory does not exist.

noSuchDir: function () {

 

},

// OK.

success: function (statusMsg) {

 

},

});

Inputs

dir required

Path (relative or absolute) to the working copy to get the status of.

'./'

Exits

error

An unexpected error occurred.

notRepo

Specified directory is not a git repository (and neither are any of its parents)

forbidden

Insufficient permissions (i.e. you might need to use `chown`/`chmod`)

noSuchDir

Specified directory does not exist.

success

OK.

'On branch master\nChanges not staged for commit:\n  (use "git add <file>..." to update what will be committed)\n  (use "git checkout -- <file>..." to discard changes in working directory)\n\n\tmodified:   status.js\n\nno changes added to commit (use "git add" and/or "git commit -a")\n'