Skip to content

Instantly share code, notes, and snippets.

@gka
Created May 11, 2016 20:45
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gka/ff45c5148ad80b53d1d52641006b1194 to your computer and use it in GitHub Desktop.
Save gka/ff45c5148ad80b53d1d52641006b1194 to your computer and use it in GitHub Desktop.
git-go
#!/usr/bin/env node
var cmds = [];
if (process.argv.length < 3) {
console.log('You need to provide a commit message required!');
process.exit(-1);
}
cmds.push('git add -A');
cmds.push('git add -u');
cmds.push('git commit -m "'+process.argv.slice(2).join(' ')+'"');
cmds.push('git pull');
cmds.push('git push');
require('child_process').exec(cmds.join(' && '), function(err, stdout, stderr) {
if (err) console.error(err);
if (stdout) console.log(stdout);
if (stderr) console.error(stderr);
});
@gka
Copy link
Author

gka commented Jun 20, 2016

usage:

git-go JUST PUSH THIS ALREADY 

this is a node port of @jashkenas ruby git-go

@gka
Copy link
Author

gka commented Oct 5, 2016

following @1wheel's advice, git-go is now a npm package that you can simply install using

npm install -g git-go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment