Apart from simply exposing git(dir, args, callback, [logger])
there are a couple of nice utilities.
npm install gits
var gits = require('gits');
API:
gits.align(dir, callback)
- runs git reset, recovery commands and git pull in a directorygits.sync(origin, branch, dir, callback)
- clones/pulls origin/branch into dirgits.bsync(origin, target, branches, prefix, callback)
- clones multiple branches (or all if branches is null) from origin into subdirectories under target dir. 'prefix' is prepended to subdirectory namesgits.bsyncAll(origin, target, prefix, callback)
- clones all branches from origin into targetgits.currentBranch(dir, callback)
- returns the current branch of a directorygits.git(dir, argsArray, callback, [logger])
- just runs git command linegits.remotes(dir, callback)
- returns a hash with the remotes in the repogits.log(dir, opts, callback)
- lists all the commits under a directorygits.prune(dir, callback)
- runs "git remote prune origin" for a directorygits.pruneAll(basrDir, callback)
- runs "git remote prune origin" against all subdirectories of "baseDir"
MIT