Message 'src refspec master does not match any' when pushing commits in Git

前端 未结 30 1734
轮回少年
轮回少年 2020-11-22 02:49

I clone my repository with:

git clone ssh://xxxxx/xx.git 

But after I change some files and add and commit them,

30条回答
  •  伪装坚强ぢ
    2020-11-22 02:53

    Maybe you just need to commit. I ran into this when I did:

    mkdir repo && cd repo
    git remote add origin /path/to/origin.git
    git add .
    

    Oops! Never committed!

    git push -u origin master
    error: src refspec master does not match any.
    

    All I had to do was:

    git commit -m "initial commit"
    git push origin master
    

    Success!

提交回复
热议问题