본문 바로가기
오류

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

by 신방동불주먹 2022. 10. 31.

 

 

<원인>

git commit 없이 push 하려고 해서 발생

 

 

-다시 remote 하려고 함 

$ git remote add origin https://github.com/yourim0/HTMLCSS.git
error: remote origin already exists.

 

- remote 삭제 

$ git remote remove origin

$ git remote add origin https://github.com/yourim0/HTMLCSS.git

$ git remote -v

 

그래도 안됨

 

<해결 방법>

 

1. 폴더 내 .git 삭제

2. 다시 git init

3. git add .

4. git commit -m "메세지"

5. $ git remote add origin https://github.com/yourim0/HTMLCSS.git

6. git push origin master