본문 바로가기

똑소리-IT/GitHub

[GitHub] error: src refspec master does not match any.



error: src refspec master does not match any.



github를 사용하여 push를 하고자할때 다음과 같은 에러메시지가 발생한적이있다.


git push -u origin master


error: src refspec master does not match any.

error: failed to push some refs to 'URL'


이는 repository에 commits한 내용이 없기때문에 server에 추가할 branch 또한 존재하지않아 발생한 에러이다.

즉, repository가 비어있음을 이야기한다.


따라서 repository에 처음 commits할 내용을 만들면 다음 문제는 해결된다.


touch initial


git add initial


git commit -m "initial commit"


git push -u origin master