Get the current "working tree status" of a local git repo.
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) {
},
});
Path (relative or absolute) to the working copy to get the status of.
'./'
An unexpected error occurred.
Specified directory is not a git repository (and neither are any of its parents)
Insufficient permissions (i.e. you might need to use `chown`/`chmod`)
Specified directory does not exist.
OK.
'On branch master\n' +
'Changes 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' +
'\n' +
'no changes added to commit (use "git add" and/or "git commit -a")\n'