2

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)

2
  • can you please elaborate the complete process? Commented Jun 1, 2015 at 11:24
  • If you use a ssh key, you can use the command line without enter password. Commented Jun 1, 2015 at 13:47

1 Answer 1

1

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"
Sign up to request clarification or add additional context in comments.

2 Comments

Maybe it's better if you elaborate
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.