2017-05-17 2 views
2

ssh를 사용하여 git 저장소를 복제하는 동안 이상한 문제가 발생했습니다. 나는 ssh 설치가있다 :Github SSH는 작동하지만 ssh를 사용하는 복제는 실패합니다.

나는 적당한 복제 URL을 사용하고 있고 복제하고 싶은 repo에 접근이있다. 그러나 오류가 발생했습니다 :

➤ git clone [email protected]:<some-org>/<repo>.git 
Cloning into 'project'... 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

내 ssh 설치 또는 git 구성에 문제가있는 경우 디버깅 할 수있는 다른 메시지는 없습니다.

답변

3

.gitconfig에 ssh가 https로 바뀌 었음을 알게되었습니다.

[url "https"] 
    insteadOf = git 

일부 도구를 사용하는 동안 실수로이 항목을 추가했을 수 있습니다. 따라서 복제 명령이 실제로 URL을 사용하고 있습니다. [email protected]:<some-org>/<repo>.git

위의 항목을 .gitconfig에서 제거한 후에 문제가 해결되었습니다.

관련 문제