在Git中找不到远程引用HEAD [英] Couldn't find remote ref HEAD in Git
问题描述
我通过那个bonobo创建了一个新的存储库SFK。
然后我克隆进来:
git clone http://localhost/Bonobo.Git.Server/SFK .git
git addtrans.cs
git commit -madded
git push http://localhost/Bonobo.Git.Server/SFK.git
一切正常。
当我尝试使用
git pull http://localhost/Bonobo.Git.Server/SFK.git
它出现此错误
致命:
无法找到远程引用HE
命令流意外结束
我哪里错了?我对这个git和倭黑猩猩很陌生。
请建议如何解决这个问题。
更新:
git config --global pull.default current
git config --global push。默认当前
它有效。
这些设置允许git知道要推送什么或从中拉出什么:
推送当前分支在接收端更新同名的分支。适用于中央工作流程和非中央工作流程。
只应该是:
git config --global push.default current
(我不知道这个设置是否为拉)
我会推荐:
- 使用远程名称而不是它的url:origin
- 使用推送功能在本地和 上游分行 :
所以:
git push -u origin master
git pull origin
之后,一个简单的 git push
就足够了:参见为什么我需要显式推送新分支?以获取更多信息。
I installed bonobo git server on windows 7.
I created a new repository "SFK" through that bonobo.
Then I cloned into that like:
git clone http://localhost/Bonobo.Git.Server/SFK.git
git add "trans.cs"
git commit -m "added"
git push http://localhost/Bonobo.Git.Server/SFK.git
Everything works.
Bit When I try to pull using
git pull http://localhost/Bonobo.Git.Server/SFK.git
It gives this error
fatal:
Couldn't find remote ref HE
Unexpected end of command stream
Where am I going wrong? I am new to this git and bonobo. please suggest how to rectify this.
UPDATE:
I tried this after push.
git config --global pull.default current
git config --global push.default current
It worked.
Those settings allow git to know what to push to or what to pull from:
push the current branch to update a branch with the same name on the receiving end. Works in both central and non-central workflows.
It should only be:
git config --global push.default current
(I am not aware of that setting for pull)
I would recommend:
- using the remote name instead of its url: origin
- using a push with makes a tracking connection between your local and upstream branch:
So:
git push -u origin master
git pull origin
After that, a simple git push
will be enough: see "Why do I need to explicitly push a new branch?" for more.
这篇关于在Git中找不到远程引用HEAD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!