Skip to content

Instantly share code, notes, and snippets.

@kadamwhite
Created April 2, 2015 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kadamwhite/975d98a73d6376c38d40 to your computer and use it in GitHub Desktop.
Save kadamwhite/975d98a73d6376c38d40 to your computer and use it in GitHub Desktop.
get changed files from Git, with Node
var diff = require('child_process').spawn('git', [
'diff',
'--name-only'
]);
diff.stdout.on('data', function (data) {
var files = data.toString().split('\n').filter(function(val) {
// Filter out ""
return val;
});
console.log('files', files);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment