0

I'm creating a node.js CLI to automate my tasks , one of the tasks is git and the init, add,commit, remote are working just fine now the problem within the push .

Note I use shellJS to execute the commands .

the code I tried is :

shell.exec('git push origin master');

now the problem is I get this error :

bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument

now how to pass the username to the git push ? or simply run the git push from inside out the script I mean when I finish the others tasks I should use something to run the git push like running a bat file (I tried that too).

Saber Hosney
  • 112
  • 1
  • 12
  • If you `cd` to your project directory and run `$ cat .git/config` does it return the correct remote `url` for the project on _github_. For example `url = git@github.com:username/project-name.git`. – RobC Oct 06 '17 at 11:20
  • @RobC I guess your url is the right one, i get this url `url = https://github.com/pro-devel/testing-clinix.git` :\ – Saber Hosney Oct 06 '17 at 11:58
  • No, your `url` is the correct one. The `url` I provided was just a pseudo example. – RobC Oct 06 '17 at 14:15
  • @RobC so do you have sny solutions ? – Saber Hosney Oct 06 '17 at 23:37
  • No not specifically, however the discussion in this thread starting [here](https://github.com/hexojs/hexo-deployer-git/issues/71#issuecomment-299627697) regarding the `could not read Username for 'https://github.com': Invalid argument` error may be worth exploring. – RobC Oct 07 '17 at 15:05

0 Answers0