作者:gavinwu | 来源:互联网 | 2023-05-20 08:46
SoIhaveproblemlistedintitle.题目中列出了问题。Iwanttousejustgitpush-uoriginmaster.我想用gitp
So I have problem listed in title.
题目中列出了问题。
I want to use just git push -u origin master
.
我想用git push -u源程序。
But if this command typed I'm getting:
但是如果我输入了这个命令:
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/myprofile/my_project.git'
I did a search on this problem(git: error: src refspec master does not match any, src refspec master does not match any when pushing commits in git) - but solutions didn't help in my case.
我搜索了这个问题(git: error: src refspec master不匹配任何内容,src refspec master在git中推送提交时不匹配任何内容)——但是解决方案对我的情况没有帮助。
Seems like I just forget to do some initial commit to original remote branch and instead created another branch which then was used.
似乎我只是忘记了对原始远程分支进行一些初始提交,而是创建了另一个分支,然后使用它。
This is output from git ls-remote
:
这是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
This is github graph's network window:
这是github的网络窗口:
So to sum up - what should I do to properly use git push -u origin master
instead git push -u origin origin:master
?
综上所述,我应该怎么做才能正确地使用git push -u source master而不是git push -u origin:master ?
EDIT:
编辑:
$ git branch -avv
git分支-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
git remote - v美元
origin https://github.com/myprofile/my_project.git (fetch)
origin https://github.com/myprofile/my_project.git (push)
1 个解决方案