我有一个 Gitlab 存储库,其中包含许多我可以使用 Git Bash 拉取和推送文档的项目。我想建立新项目。在 Gitlab 网站上,我创建了新项目,并按照 Git Bash 中的常规说明进行操作:
cd existing_folder
git init
git remote add origin git@gitlab.com:new_project_name.git
git add .
git commit -m "Initial commit"
git push -u origin master
但是,当我尝试推送时(上面的最后一行出现错误:
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'git@gitlab.com:new_project_name.git'
(注意:本文中的项目名称已被 new_project_name 替换)
有一个准备提交的自述文件。
我知道我错过了什么或做错了什么,但我不知道是什么。我不明白为什么我可以推送到其他项目(拉/推送工作正常)但不是这个。我需要做什么才能git push
到存储库?