//log my lifestyle

[error] git remote: Not Found fatal: repository not found 에러 본문

Web/Git

[error] git remote: Not Found fatal: repository not found 에러

zici 2021. 10. 11. 01:38

어젯밤에 이어서

 commit을 해도 push를 할때마다 오류가났다.

 

git@github.com: Permission denied (publickey).

어제는 어찌저찌 따라 눌러보고 하다가 push 성공했는데 오늘 새로운 리포지토리생성후 커밋을했는데 

또 푸쉬가 안되는것이다. 

그때부터 시작된 not found 오류의 개미지옥..

git remote: Not Found fatal: repository not found

공식문서를 통해 확인해보았다

 

https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/error-repository-not-found


"repository가 존재하지 않거나 그 repository에 접근 권한이 없기 때문이다."

 

이말은 즉

 

  1. 오타가 없는지 확인하기
  2. 접근 권한이 있는지 확인하기
  3. SSH access 에 대해서 확인하기

처음에는 url 경로가 맞게 되어있지않았다. 

$ git remote -v
# View existing remotes
> origin  https://github.com/ghost/reactivecocoa.git (fetch)
> origin  https://github.com/ghost/reactivecocoa.git (push)

$ git remote set-url origin https://github.com/ghost/ReactiveCocoa.git
# Change the 'origin' remote's URL

$ git remote -v
# Verify new remote URL
> origin  https://github.com/ghost/ReactiveCocoa.git (fetch)
> origin  https://github.com/ghost/ReactiveCocoa.git (push)

그래도 계속 오류가 나왔는데 원인가능성중에 어제 ssh키를 생성했기때문에 이쪽일 가능성이 큰것같았다.

설정창에 ssh키를 확인해봤는데 never used라 되어있고, 접근이 막힌걸까?

나는 처음에 키를 생성하면 자동으로 로컬에도 등록이 되는건줄알았다.

 

 

Testing your SSH connection - GitHub Docs

After you've set up your SSH key and added it to your GitHub account, you can test your connection.

docs.github.com

공식문서를 통해 테스트를 해보자

$ ssh -T git@github.com

 개인키가 등록이 안되어있다. 

 

#ssh-agent를 시작
$ ssh-agent -s
#개인키를 등록
$ ssh-add ~/.ssh/id_rsa

여전히 해결이안됐다.

 

#ssh-agent를 시작
$ eval $(ssh-agent)
#개인키를 등록
$ ssh-add ~/.ssh/id_rsa

위의 방법으로 했더니 드디어 

hi username!이 떴다. 

그러고 push 성공

 

정말 길었던 삽질이었다. 몇시간내내 하면서 왜안되나 해당 에러를 해결한 여러 블로그와 영어사이트를 전전했지만 

제일먼저 공식문서를 확인하고 내가 오류난 원인을 아는게 제일 빠른해결의 길임을 느꼈다.

깃헙을 써본지 며칠밖에안되었지만,..오류덕분에 커맨드와 터미널창에 조금이나마 익숙해진것같다. 

 

참고

https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey

https://rutesun.wordpress.com/2015/02/04/git-bash-%EA%B0%9C%EC%9D%B8%ED%82%A4-%EB%93%B1%EB%A1%9D%EC%8B%9C-%EC%97%90%EB%9F%AC/

'Web > Git' 카테고리의 다른 글

[error] failed to push some refs to에러  (0) 2021.10.19
git status  (0) 2021.08.18