본문 바로가기
Programming/삽질일기

[GitHub] Personal access tokens으로 private repository 내려받기 remote: Repository not found.

by kghworks 2024. 1. 18.

GitHub logo

문제

$ git clone <git repository url>
Cloning into <git repository url>...
remote: Repository not found.                                                    
fatal: repository <git repository url> not found

 

GitHub private repository를 내려받으려는 중 위 처럼 repository url을 인식하지 못하는 오류 발생. 

 

원인

해당 Repo에 접근할 수 있는 Git 계정이 OS에 설정된 Git 계정과 달라서 발생하는 문제로 예상. 로컬에서 여러 GitHub 계정을 사용할 것이기 때문에 글로벌 설정을 해주어도 매번 바꿔주어야함

 

해결

GitHub에서 Personal access tokens (classic)을 발급받아 아래처럼 url에 붙여서 사용

$ git clone <Personal access tokens>@<git repository url>
Cloning into <git repository>...
remote: Enumerating objects: 502, done.
remote: Counting objects: 100% (502/502), done.
remote: Compressing objects: 100% (396/396), done.
Receiving objects:  99% (497/502), 5.47 MiB | 10.93 MiB/sck-reused 0 eceiving objects:  98% (492/502), 5.47 MiB | 10.93 MiB/s
Receiving objects: 100% (502/502), 8.10 MiB | 10.97 MiB/s, done.
Resolving deltas: 100% (102/102), done.

 

 

 

참고

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

 

Managing your personal access tokens - GitHub Docs

You can use a personal access token in place of a password when authenticating to GitHub in the command line or with the API.

docs.github.com

 

댓글