所以我在标题中列出了问题。
我只想使用git push -u origin master
。
但是,如果键入此命令,我将得到:
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/myprofile/my_project.git'
我对此问题进行了搜索(git:错误:src refspec master不匹配,src refspec master在git中推送提交时不匹配)-但是解决方案对我而言没有帮助。
似乎我只是忘记对原始远程分支进行一些初始提交,而是创建了另一个分支,然后使用了该分支。
这是从输出git ls-remote
:
$ git ls-remote
From https://github.com/myprofile/my_project.git
152e795f054f6f756842bf61ee968ba3e5ee873d HEAD
7d505dbf09585ecfbb239c2148337043b899cc13 refs/heads/add-mysql-repo
152e795f054f6f756842bf61ee968ba3e5ee873d refs/heads/break-into-modules
e7905a3dacc9ea3e6c4c1f2dd9412f8deb692e30 refs/heads/master
这是github图的网络窗口:
所以总结起来-我应该怎么做才能正常使用git push -u origin master
,而不是git push -u origin origin:master
?
编辑:
$ git branch -avv
add-mysql-repo 7d505db add mysql case to switch
break-into-modules 152e795 add gitignore
* origin e7905a3 [origin/master] add methods for entities validation
remotes/origin/master e7905a3 add methods for entities validation
$ git remote -v
origin https://github.com/myprofile/my_project.git (fetch)
origin https://github.com/myprofile/my_project.git (push)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句