Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未能使用git pull“;不能';“找不到远程参考xxx”;_Git - Fatal编程技术网

未能使用git pull“;不能';“找不到远程参考xxx”;

未能使用git pull“;不能';“找不到远程参考xxx”;,git,Git,我提出了一个关于git pull的问题 首先,我在“test_http_1204”分支 然后我使用git pull,得到一条错误消息 root@inception-server-Quantal:~/bosh# git pull m109bosh test_http_1204 fatal: Couldn't find remote ref test_http_1204 Unexpected end of command stream 但是,我可以在远程回购“m109bosh”中

我提出了一个关于git pull的问题

首先,我在“test_http_1204”分支

然后我使用git pull,得到一条错误消息

 root@inception-server-Quantal:~/bosh# git pull m109bosh test_http_1204
    fatal: Couldn't find remote ref test_http_1204
    Unexpected end of command stream
但是,我可以在远程回购“m109bosh”中找到分支“test_http_1204”

并且,.git/config的内容如下所示:

  root@inception-server-Quantal:~/bosh# cat .git/config 
    [core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
    [remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = https://github.com/cloudfoundry-community/bosh-cloudstack-cpi.git
    [branch "master"]
        remote = origin
        merge = refs/heads/master
    [branch "ubuntu1204"]
        remote = origin
        merge = refs/heads/ubuntu1204
    [remote "m109bosh"]
        url = https://github.com/m1093782566/bosh-cloudstack-cpi.git
        fetch = +refs/heads/*:refs/remotes/m109bosh/*
        url = https://github.com/m1093782566/bosh.git
我想根本原因可能是.git/config中缺少[branch“test_http_1204”],但当我手动将这些行添加到.git/config时,它仍然无法工作

[branch "test_http_1204"]
        remote = m109bosh
        merge = refs/heads/test_http_1204

我对此一无所知。你能告诉我怎么修吗?谢谢

基于
git ls remote
输出(以前在注释中,现在不见了-注释中不太合适),它看起来像是以前远程设备有一个名为
test\u http\u 1024
的分支,但现在不再有了

换句话说,无论谁控制遥控器,他都执行了一个git分支-d(或类似的操作)来删除他们的分支
test\u http\u 1024
。这意味着,当您询问
git pull
该分支的内容时,它只能告诉您:“呃?什么?什么分支?”:-)

当您查看自己的远程分支集时,您可以看到它们以前有一个分支
test\u http\u 1024
(当它存在时,您的git将其复制到
remotes/m109bosh/test\u http\u 1204
)。但他们可以随时添加或删除分支

如果运行
git fetch-p m109bosh
git remote update--prune m109bosh
,您自己的git将删除其
test\u http\u 1024
分支的(旧的、过时的)副本。(如果您仍在将其用于某些用途,则可能不希望执行此操作。)


一个可能更重要的问题是:

[remote "m109bosh"]
    url = https://github.com/m1093782566/bosh-cloudstack-cpi.git
    fetch = +refs/heads/*:refs/remotes/m109bosh/*
    url = https://github.com/m1093782566/bosh.git

有两个不同的
url=
行。大概其中一个已经过时了。(
git fetch
使用第一个,所以第二个可能就是您想要的。)

试试:
git ls remote m109bosh
。我相信问题在于,remote
m109bosh
过去有一个
测试,但现在不再有了。是的,这表明remote有分支
master
patch-1
,和
ubuntu1024
。解决了!谢谢因为,远程回购“m109bosh”有2个URL!啊哈,是的。它只会使用其中一个。
[branch "test_http_1204"]
        remote = m109bosh
        merge = refs/heads/test_http_1204
[remote "m109bosh"]
    url = https://github.com/m1093782566/bosh-cloudstack-cpi.git
    fetch = +refs/heads/*:refs/remotes/m109bosh/*
    url = https://github.com/m1093782566/bosh.git