본문 바로가기

Programming/git

git error Git-Repository not found

문제의 발단 : git push error 발생

정말 얼탱이 털리는 일이 일어났다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 잘 사용하던 git이 갑자기 안된다며 에러를 내비쳤다.

error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/gitusername/portfolio.git'

해결법 1: git pull & git fetch -> 실패!

git pull, fetch

리모트 브랜치에도 별다른 변화같은 것은 없지만, 혹시나 하는 마음으로 pull과 fetch를 했다.

error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
remote: Repository not found.
fatal: repository 'https://github.com/gitusername/portfolio.git/' not found

pull도 fetch도 둘 다 실패 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

 

해결법 2: git 재클론 -> 실패

git clone error

clone을 다시해보자고 결심! not found가 또 나를 반겨줬다.

ssh로 연결했는데 클로닝 실패 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

not found라니...! not found라니!!!!!

git clone error

아무튼 그래서 차분히 나에겐 https로 클론을 하면 된다!라고 생각해서 실행했다.

실패...ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

ls로 디렉토리 내 파일이 있는지 확인했다. 역시 없음ㅋㅋㅋㅋㅋㅋ

 

해결법 3: git username과 함께 클론하기 -> 성공

git clone https://gitid@github.com/gitusername/portfolio.git

gitusername라고 쓴 부분에 나의 gitusername을 입력하고 clone하니 성공!

 

원인: 이중계정을 사용하고 있었기 때문

원인은 현재 노트북으로 개인업무와 회사업무를 같이 관리하고 있는데, 요즘 회사업무만 하고 있다보니 키 체인이 회사에 연결해 놓은걸로 연결되어서가 아닌가 짐작해본다. git설정에서 ssh키 부분은 별 다른 상관은 없는 것 같았고, 업무할때도 무난히 진행할 수 있었어서 로컬의 문제였다. 어쨌든 일 외에도 개인 프로젝트는 손을 뗀지 좀 되서 일어나는 문제가 아니였나 반성해본다.