'git remote 암호저장'에 해당되는 글 1건

  1. 2018.07.02 git remote 암호저장( 깃 원격저장소 암호 저장)
2018. 7. 2. 16:13

git 원격저장소 추가.

 

git init 을 하여, 폴더를 초기화 시키고,

 

git add . 

파일추가

 

git remote add origin <url> 

 

이렇게 처음에 원격저장소를 추가하는데, 

 

git remote add origin http://user@192.168.0.52:9000/www/html



이렇게 했더니, pull 할때마다 암호를 물어본다.

 

귀찮으면, 처음부터 암호를 저장했어야 했다.

 

git remote add origin http://user:password@192.168.0.52:9000/www/html

 

 

[유저명:암호]

 

이렇게 했어야 했는데....

 

또는 git clone 해서 했는데, 암호를 처음에 안적었더니...

 

pull 할때마다, 암호를 적어줘야한다.

 

그래서 암호를 저장해서 다시 설정해야한다.

 

[root@localhost]# git remote -v

origin  http://user@192.168.0.52:9000/www/html (fetch)

origin  http://user@192.168.0.52:9000/www/html (push)

 

 

git remote -v 하면, 위처럼, origin에 저장된 주소가 나온다.

 

http:// 뒤에 user 가 내 아이디이다.

 

뒤에 ,user:password 이렇게썼으면, 암호가 저장되었을거다.

 

[유저명:암호]@주소 이렇게 써주면 된다.

 

그래서 origin (remote의 정보를 바꿔줘야한다.)

 

밑에처럼 치면 된다.

 

git remote set-url origin http://user:password@192.168.0.52:9000/www/html

 

 

git remote set-url origin [유저id:암호@주소] 

 

이런식으로 서주면 바뀐다.

 

git remote -v 로 확인해 본다.

 

 

 

Posted by Tyson