Git: error: src refspec master does not match any即使运行Git com



运行git init,git add .,git commit -m "Test",最后git push origin master --force后,我仍然得到以下错误:

错误:src refspec master不匹配任何

在做git push -u origin master之前:
git remote add origin <repo_git>
如果使用github, repo git将:
https://github.com/username/reponame.git
或者只需点击github repo上的code按钮并复制链接。

如果在"git remote add origin"之后问题仍然存在,那么尝试按如下方式提交并再次运行push命令,问题应该会解决。

git commit -m &;initial commit&;——allow-empty

相关内容