I wondered: - is it possible to create a script that wakes the machine to komitite files on github ?
- Probably Yes, and probably this should be done through the execution of the commands in git bash. I said to myself and searched the Internet.
Created a repository in hand in hand made a few..
Then prescribed
var exec = require('child_process').exec; exec('git status',{cwd:'./public/'},function(error,stdout,stderr){console.log(stdout);});
And when I saw reply I was very glad
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD ..." to unstage) modified: library.js modified: library.min.js
Then another line
exec('git add .',{cwd:'./public/'},function(error,stdout,stderr){console.log(stdout);});
And the answer
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD ..." to unstage) modified: library.js modified: library.min.js
Then
exec('git commit-m "',{cwd:'./public/'},function(error,stdout,stderr){console.log(stdout);});
And
exec('git push -u origin master',{cwd:'./public/'},function(error,stdout,stderr){console.log(stdout);});
But received in response only the end of the answer
Branch master set up to track remote branch 'master' from 'origin'.
I go into the repository and everything is as it was all that remained
As sdelat so that the script itself was filled with the desired files in the git repository ?