728x90
반응형

어느날 잘 되던 git pull 명령어가 갑자기 오류가 나기 시작했습니다.

 

인터넷에 검색을 해 보면 ssh 인증키 등록을 해야한다는 글이 많아서

 

https://stackoverflow.com/questions/2643502/git-how-to-solve-permission-denied-publickey-error-when-using-git 

 

Git: How to solve Permission denied (publickey) error when using Git?

I'm on Mac Snow Leopard and I just installed git. I just tried git clone git@thechaw.com:cakebook.git but that gives me this error: Initialized empty Git repository in `/Users/username/Documents/

stackoverflow.com

 

이런 글들을 통해서 ssh key 등록을 하고 

아래사진처럼 set-url 설정까지 마치니까

 

 

위의 사진처럼 pull 은 되는데 push 는 되지 않는 어처구니 없는 상황이 발생합니다.

 

한참을 인터넷을 뒤진 끝에

 

 

위처럼

git remote -v 

명령어를 쳐보니까

fetch url 과 push url 이 다르게 설정되있는 것을 확인했습니다. 

git remote set-url 명령어 만으로는 push url 까지는 바뀌지 않나봅니다.

 

 

그래서 위의 사진처럼 git remote set-url --push origin git@github주소.git

 

이렇게 등록을 해 주면

git pull 과 push 가 모두 잘 동작하게 됩니다.

728x90
반응형

+ Recent posts