본문 바로가기
TIL/Git

Git | fatal: remote origin already exists

by 홍차23 2020. 10. 15.

폴더를 통째로 복사했다가 숨겨져 있던 .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 까지 원래 하려고 했던 레포지토리 초기 푸시 순서대로 입력한다. 

 

 

 

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

Git | error: failed to push some refs to  (0) 2020.12.11
Git | branch conflict 해결하기  (0) 2020.11.23
Git | revert  (0) 2020.10.15
Git | fatal: No such remote  (0) 2020.10.15

댓글