繁体   English   中英

在Git中找不到远程ref HEAD

[英]Couldn't find remote ref HEAD in Git

我在Windows 7上安装了bonobo git服务器。

我通过这个倭黑猩猩创建了一个新的存储库“SFK”。

然后我克隆成那样:

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

一切正常。

当我试图拉动使用时

git pull http://localhost/Bonobo.Git.Server/SFK.git

它给出了这个错误

fatal:
Couldn't find remote ref HE
Unexpected end of command stream

我哪里错了? 我是这个git和bonobo的新手。 请建议如何纠正这个问题。

更新:

推后我试过这个。

git config --global pull.default current
git config --global push.default current

有效。

这些设置允许git知道要推送什么或从中提取什么:

推送当前分支以更新接收端具有相同名称的分支。 适用于中央和非中央工作流程。

它应该只是:

git config --global push.default current

(我不知道拉的设置)

我建议:

  • 使用远程名称而不是其url:origin
  • 使用push with在本地和上游分支之间建立跟踪连接:

所以:

git push -u origin master
git pull origin

在那之后,一个简单的git push就足够了:请参阅“ 为什么我需要明确地推送一个新分支? ”以获取更多信息。

推后我试过这个。

git config --global pull.default current
git config --global push.default current

拉完后我试过这个命令..

然后,当我推它时它工作..我仍然需要知道这背后的场景?

真的这是单独的原因还是?

如果有人想出来请回复..

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM