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

前端 未结 30 1814
轮回少年
轮回少年 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:56

    1. Try git show-ref to see what refs you have. Is there a refs/heads/master?

    Due to the recent "Replacing master with main in GitHub" action, you may notice that there is a refs/heads/main. As a result, the following command may change from git push origin HEAD:master to git push origin HEAD:main

    1. You can try git push origin HEAD:master as a more local-reference-independent solution. This explicitly states that you want to push the local ref HEAD to the remote ref master (see the git-push refspec documentation).

提交回复
热议问题