Skip to content

Instantly share code, notes, and snippets.

@webuti
Last active November 18, 2016 15:46
Show Gist options
  • Save webuti/8e3a12fd6ae4068cb76140d22f61c4b8 to your computer and use it in GitHub Desktop.
Save webuti/8e3a12fd6ae4068cb76140d22f61c4b8 to your computer and use it in GitHub Desktop.
nodejs ssh login and git pull
/* npm install simple-ssh */
var SSH = require('simple-ssh');
var ssh = new SSH({
host: '2.2.2.2',
user: 'root',
pass : 'root'
});
ssh.exec('cd /var/www/site.com/public_html/ && git pull', {
pty: true,
out: function(stdout) {
console.log(stdout);
}
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment