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

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

    In my case, I forgot to include the .gitignore file. Here are all the steps required:

    1. Create an empty Git repository on remote,
    2. On local create the .gitignore file for your project. GitHub gives you a list of examples here
    3. Launch a terminal, and in your project do the following commands:

      git remote add origin YOUR/ORIGIN.git
      
      git add .
      
      git commit -m "initial commit or whatever message for first commit"
      
      git push -u origin master
      

提交回复
热议问题