I want to push a directory to Github via nodejs app. Here's what I currently do. I take username, password and new repository name from user. Then, I create new repository via Github API(https://developer.github.com/v3/repos/#create). Now I want to push some specific code to this repository. I can't use node.js child process (git push origin master), because that requires username and password. How can I push code to Github via API. (And if via command line, then without entering password manually)
1 Answer
To skip the password on each commit you need to tell the git to store the credential in a separate place. This can be done by using the following command:
git config --global credential.helper cache
This will store the password for 15 minutes. If you wish you can extend this time by specifying the amount of duration in milliseconds:
git config --global credential.helper "cache --timeout=3600"
2 Comments
Endre Simo
Maybe it's better if you elaborate
manish
I have node-angular app, and i ask user his github username and password via UI. Now at the backend, i want to push some code to user's github account.