在Git中找不到远程ref HEAD

时间:2013-11-25 05:02:38

标签: git version-control bonobo

我在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

有效。

2 个答案:

答案 0 :(得分:6)

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

  

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

应该只是:

git config --global push.default current

(我不知道拉的设置)

我建议:

  • 使用远程名称而不是其url:origin
  • 使用推送功能可在您的本地与 upstream branch 之间建立跟踪关联:

所以:

git push -u origin master
git pull origin

之后,一个简单的git push就足够了:更多信息请参见“Why do I need to explicitly push a new branch?”。

答案 1 :(得分:2)

我在推后尝试了这个。

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

我拉了之后试过这个命令..

然后,当我推它时,它的工作原理.. 我还需要知道这背后的情景吗?

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

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