TIL/Git

Git | fatal: remote origin already exists

홍차23 2020. 10. 15. 23:23

폴더를 통째로 복사했다가 숨겨져 있던 .git 파일도 같이 복사되는 바람에 origin 저장소가 겹쳐 버렸다. 

 

error: src refspec master does not match any

error: failed to push some refs to

 

fatal: remote origin already exists. //원격저장소가 이미 존재한다는 뜻이므로 

1) 'git remote -v' 명령어로 현재 origin 저장소를 확인한다.

2) 'git remote rm origin' 명령어로 origin 을 삭제

3) 'git intit' 으로 저장소 초기화

git add .

git push 까지 원래 하려고 했던 레포지토리 초기 푸시 순서대로 입력한다.