[Git Error] remote: Repository not found (git config credential 설정)

Yuri Lee·2021년 1월 15일
0

배경

나는 git 계정을 2개 사용하고 있다. 원래 개인 git 계정만 사용하다가 회사 프로젝트를 진행할 때 불편함을 느껴 회사용 git 계정을 추가했었다.

  • 개인 계정 (global 설정)
  • 회사 계정 (company-project 폴더를 만들어서 그 안에 생성된 폴더 한정적으로 설정해놓음)

팀 깃서버에 올려져있는 스프링 부트를 company-project 에 clone 해서 작업 할때는 잘 작동을 했다. 동료가 개인 repository를 만들어서 작업 중이였고, collaborator 로 내 회사 계정을 추가하여 추가 작업을 하려고 했다. private repository를 clone 하고 수정 내용을 push 하려는 도중 다음과 같은 에러가 발생했다.

Repository not found.

remote: Repository not found.
fatal: repository 'https://github.com/MyRepo/project.git/' not found

그동안 같은 방식으로 잘 써왔는데 무엇이 문제인지 🙄🙄 구글링을 했다.

Delete the credentials from Credential Manager.

credentials 문제로 삭제를 하면 되는 것 같았다.

해결

$ git credential-manager uninstall

$ git credential-manager install

사실 이 명령어가 무언가 두려워서 이 방법을 쓰지 않으려고 했는데, 다른 방법이 안통해서 시도했다. 그 결과 작동성공! 하지만 매번 git id와 password를 입력해줘야 하는 번거로움이 생겼다. 인텔리제이 안에서 프로젝트 파일을 수정할 때마다 매번 git 계정을 입력해줘야 하는 ...😓😓

번외: Git pull/push 시 Password 물어보지 않도록 설정

git을 쓰다보면 간혹 config 미스, 환경 변경으로 push/pull 등 기능 실행 시 계정과 패스워드를 물어보는 경우가 발생한다. 그때 Credential 를 다시 설정해주면 된다.

  1. Credential 정보 저장
git config credential.helper store

credential.helper의 store 옵션을 주게되면 해당 git directory에선 반영구적으로 인증 절차가 생략된다.(저장된 credential 정보를 이용해 인증 처리)

  1. 모든 프로젝트에 적용
git config credential.helper store --global

git config의 공통적인 설정과 같이 --global 옵션을 주게되면 해당 git directory 이외에 모든 git 활동에서 저장된 정보를 이용할 수 있다.

더이상 인텔리제이에서 id, password를 물어보지 않는다. 😀😀😀


https://o-yeon.tistory.com/90
https://stackoverflow.com/questions/37813568/git-remote-repository-not-found
출처: https://recoveryman.tistory.com/392 [회복맨 블로그]
https://www.hahwul.com/2018/08/22/git-credential-helper/#section_3

profile
Step by step goes a long way ✨

0개의 댓글