0

Background

I'm working on node.js + react project.

I manage my project on a github as private mode. Because this is not a open source.

I moved my source code to Cloud Computer(Ubuntu 16.04) to deploy. I didnt want to upload my source code every time some changes happened, so I decided to use github's webhook for automated deploy.

These are the whole process to set automated deploy using github's webhook.

  1. github's webhook setting
  2. node.js server setting only to receive the post data which come from github
  3. execute deploy.sh which I made for pulling updated source code from github( git pull origin master )
  4. restart my node.js production server

So, what's your problem ?

At the nubmber 3, command line tool ask me my github's username and password because my project is private not public !.

enter image description here

I want to do like this git pull origin master -username rpf5573 -password MyPassWord. How can I pass my username and password as a arguments ?

Please give me some advice !.

Byeongin Yoon
  • 3,233
  • 6
  • 26
  • 44

2 Answers2

1

use ssh key as ssh key, github

you have to enter your password first time. then you can use git pull origin master

ThunderMind
  • 789
  • 5
  • 14
  • I had id_rsa.pub file in /home/rpf5573/.ssh and I added my ssh key into the deploy keys in my project's setting page. But the git asked me my username and password again OTL.. – Byeongin Yoon Jan 01 '19 at 10:23
  • You might got your answer from `https://stackoverflow.com/questions/11200237/how-do-i-get-git-to-default-to-ssh-and-not-https-for-new-repositories` – ThunderMind Jan 01 '19 at 10:31
  • 1
    My mistake is that I didn't change my git's remote origin to SSH. Now it works !! Thanks ~ – Byeongin Yoon Jan 01 '19 at 10:35
1

According to GitHub Help, an ssh key can help you.

tjysdsg
  • 656
  • 8
  • 19