我想出了有关git拉的问题。
首先,我在" test_http_1204"分支中,
root@inception-server-Quantal:~/bosh# git branch
master
* test_http_1204
ubuntu1204
然后我使用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
但是,我可以在我的远程存储库中找到分支" test_http_1204",
root@inception-server-Quantal:~/bosh# git branch -a
master
* test_http_1204
ubuntu1204
remotes/m109bosh/master
remotes/m109bosh/patch-1
remotes/m109bosh/test_http_1204
remotes/m109bosh/ubuntu1204
remotes/origin/HEAD -> origin/master
remotes/origin/floating_dns_registry
remotes/origin/http_stemcell_uploader
remotes/origin/master
remotes/origin/squashed
remotes/origin/ubuntu1204
remotes/origin/upstream
和.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_http_1024
,但不再使用。
换句话说,控制遥控器的人做git branch -d
(或等效的东西)以删除其分支test_http_1024
。这意味着,当您向git pull
询问该分支的内容时,它只能告诉您:"嗯?什么?什么分支?": - )
当您查看自己的一组远程分支时,您会看到它们具有一个分支test_http_1024
(在存在时,您的git将其复制到remotes/m109bosh/test_http_1204
)。但是他们可以随时添加或删除分支。
如果您运行git fetch -p m109bosh
或git remote update --prune m109bosh
,您自己的git将删除其test_http_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
使用第一个,所以也许第二个是您想要的。)