본문 바로가기

IT 모음/깃(Git) 관련 오류, 팁 모음

깃 오류 3 : Git error: src refspec master does not match any.

git push origin master 실행 시 위와 같은 오류가 나온다.

내 경우 해결법은 아래와 같았다.

Scenario 4 – Committing and pushing Empty Directory in Git

A certain version of Git like GitHub, bitbucket does not track the empty directories, so if a directory is empty and you are trying to commit and push, it will lead to an error: src refspec master does not match any.

 

Solution – Add a file to your directory before pushing it to a remote branch. 

번역하자면 아무것도 없는 파일에서 git push 를 실행할 경우 위와같은 오류가 뜬다는 뜻.

해결책으로 폴도 안에 아무거나 파일을 넣어주면 된다.

내 경우 파이썬 파일을 하나 넣어주고 실행하니 해결되었다.

 

#파일을 넣은 후 git status 를 실행해 파일이 잘 인식되는지 확인해보았다.