git-upstream-watch

Get notified when one or more local git repos diverge from the upstream tracking branch

git-upstream-watch

Get notified when one or more local git repos diverge from the upstream tracking branch.

Divergence happens when there are local commits that aren't pushed, or when there are upstream/remote commits that aren't pulled.

Getting started

$ npm install git-upstream-watch -g

Usage (command line)

  Usage: git-upstream-watch [options] [directories...]
 
  Options:
 
    -h, --help                        output usage information
    -V, --version                     output the version number
    -a, --always                      Always notify about pending changes.
    -i, --check-interval [interval]   Recheck for changes in upstream branch every n seconds. If this option is given, the process will run forever
    -n, --notify-interval [interval]  Don't notify about each repo more often than every n seconds. This option will only have an effect when --check-interval is specified
$ git-upstream-watch node browserify --always --check--interval 1800
$ git-upstream-watch ~/projects/* --always --watch --interval 1800

Usage (as a library)

require("git-upstream-watch")({checkInterval: 600, notifyInterval: 300})

This will shedule a new upstream check every ten minutes, notifying about changes at most every 5 minutes.

var check = require("git-upstream-watch/check");
 
// Check current directory 
 
check(process.cwd, function(errorstatus) {
  // Diverging commits are now found in status.commits 
  console.log(status)
});
 

License

MIT