dirty-gitdeprecated

List git repos that have dirty working directories (uncommited changes)

Usage no npm install needed!

<script type="module">
  import dirtyGit from 'https://cdn.skypack.dev/dirty-git';
</script>

README

dirty-git

npm npm license npm downloads

List git repos that have dirty working directories (uncommited changes)

Install via npm

$ npm install --global dirty-git

Command Line

$ cd ~/Code # navigate to starting point
$ dirty-git [options] [path]

CLI Options

  -i, --ignored    include ignored files
  -u, --untracked  include all untracked file paths
  -l, --symlinks   include symlinked repos in results
  -r  --unreleased force include repos that have no current tag
  -s, --staged     show stats for staged files
  -t, --tree       show stats for work tree files
  -d, --depth <n>  nested sub folders to search (default: 3)

API

var dirtyGit = require( 'dirty-git' )
var stream = dirtyGit( process.cwd(), options )
  .on( 'readable', function() {
    var repo = null
    while( repo = this.read() ) {
      // do things with it...
    }
  })
// Repository data structure
// (emitted by the dirtyGit stream)
{
  branch: { index: 'master', remote: 'origin/master' },
  status: [
    { index: 'M', tree: ' ', path: '...' },
    ...
  ],
  symlink: true | false,
  path: '...',
  relativePath: '...',
  error: null,
}

Contributors