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

前端 未结 30 1837
轮回少年
轮回少年 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 03:13

    I faced the same problem, and I used --allow-empty:

    $ git commit -m "initial commit" --allow-empty
    ...
    $ git push
    ...
    

    Supplement

    One of main reasons of this problem is that some Git servers, such as BitBucket, don't have their master branch initialized when a fresh repository is cloned.

提交回复
热议问题