在Git中找不到远程ref HEAD

sha*_*raj 5 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
Run Code Online (Sandbox Code Playgroud)

一切正常.

当我试图拉动使用时

git pull http://localhost/Bonobo.Git.Server/SFK.git
Run Code Online (Sandbox Code Playgroud)

它给出了这个错误

fatal:
Couldn't find remote ref HE
Unexpected end of command stream
Run Code Online (Sandbox Code Playgroud)

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

更新:

推后我试过这个.

git config --global pull.default current
git config --global push.default current
Run Code Online (Sandbox Code Playgroud)

有效.

Von*_*onC 6

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

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

它应该只是:

git config --global push.default current
Run Code Online (Sandbox Code Playgroud)

(我不知道拉的设置)

我建议:

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

所以:

git push -u origin master
git pull origin
Run Code Online (Sandbox Code Playgroud)

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