Git clone 시에 다른 organization 이나 다른 team 의 repo 를 clone 할때 다음과 같은 에러가 발생하는 경우가 있다.

 $git clone https://github.com/otherTeam/test.git
Cloning into 'test'...
remote: Repository not found.
fatal: repository 'https://github.com/otherTeam/test.git' not found

이때 기존에 사용했던 계정이 다른 organization 에 소속이 안된경우가 있을수 있는데 다음 부분에 파일에 내용을 살펴본다.

$cat ~/.git-credentials
https://other%40test.com:testpassword@github.com/otherTeam/test.git

위의 내용을 보면 해당 repo 에 other@test.com 이라는 계정에 testpassword 라는 암호가 저장되어있는데, clone 을 받으려는 repo 에 other@test.com 이라는 계정이 권한이 없는경우 해당 라인을 삭제한다.

이후에 원하는 repo 의 clone 을 받으려고 다시 시도하면 계정과 비번을 입력받는 창이 뜨는데, 이때 입력을 하면 제대로 clone 이 받아지게 된다.

이때 저장한 계정 정보는 위의 .git-credentails 파일에 저장되게 된다.

Posted by leechwin
,