英文:
git pull origin master not wokring
问题
每当我尝试推送我的git时,也就是使用命令"git push -u origin master"时,我会得到以下错误信息:
"error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/Username/gitname'"
我尝试了"git pull origin master"命令,但遇到了以下错误信息:
"fatal: couldn't find remote ref master"
你可以在这里找到解决方法:https://www.freecodecamp.org/news/error-failed-to-push-some-refs-to-how-to-fix-in-git/
英文:
Whenever i try to push my git that is when i use "git push -u origin master" this command
I get "error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/Username/gitname' "
I tried "git pull origin master" and ran into "fatal: couldn't find remote ref master" this error
which i found here https://www.freecodecamp.org/news/error-failed-to-push-some-refs-to-how-to-fix-in-git/
答案1
得分: 1
推送不起作用是因为你的本地仓库中似乎没有名为"master"的分支。尝试只使用git push -u origin
(不带引用名称),然后Git将默认推送到当前分支。
或者,检查你当前分支的名称(git branch
),然后执行git push -u origin <branchname>
。
类似地,我猜拉取操作不起作用是因为远程仓库中没有名为"master"的分支。
英文:
The push does not work because it seems like there is no branch named "master" in your local repository. Try just git push -u origin
(so without ref name), then Git will push will default to the current branch.
Alternatively, check the name or your current branch (git branch
) and then do git push -u origin <branchname>
.
Similarly, I suppose the pull does not work because the remote does not contain a branch named "master".
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论