Git

git error : src refspec master does not match any

Naranjito 2022. 6. 15. 14:30
  • git error

error: failed to push some refs to 'https://naranja0047:ghp_SSHKEY@github.com/illunex/ABCfood_recommendation.git'

 

  • Cause

Without commit after remote remove, I tried to push.

$ git remote remove origin 
$ git remote add origin https://naranja0047:ghp_SSHKEY@github.com/illunex/ABCfood_recommendation.git
$ git push -u origin master

>>>

error: src refspec master does not match any
error: failed to push some refs to 'https://naranja0047:ghp_SSHKEY@github.com/illunex/ABCfood_recommendation.git'

 

  • Solution

git add -> git commit -> git push

$ git add .

$ git status

>>>

On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   .gitignore
        new file:   requirements.txt

...

$ git commit -m "first commit"
$ git push origin master