error: failed to push some refs to '[email protected]:xxx/xxx.git

新建gitLabe仓库,提交报错:error: failed to push some refs to ‘[email protected]:xxx/xxx.git’

报错信息:

error: failed to push some refs to '[email protected]:xxx/xxx.git

问题过程:


$ touch README.md
$ git add README.md
The following paths are ignored by one of your .gitignore files:
README.md
Use -f if you really want to add them.
mengxiang:VhallModuleUI_demo_iOS vhall$ git commit -m “add README”
On branch master

Initial commit

nothing to commit


$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to ‘[email protected]:xxx/xxx.git’


$ git add README.md

The following paths are ignored by one of your .gitignore files:
README.md
Use -f if you really want to add them.


$ git status
On branch master

No commits yet

Changes to be committed:
(use “git rm --cached …” to unstage)

new file:   README.md

git add README.md
git commit -m “add README”
git push -u origin master


原因:README文件被忽略了,没办法被跟踪,所以添加不上导致的。

发布了131 篇原创文章 · 获赞 9 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/Morris_/article/details/103145025