gpt4 book ai didi

git - 为什么 'git remote show '显示remote HEAD不明确,可能是以下之一

转载 作者:行者123 更新时间:2023-12-05 08:01:34 24 4
gpt4 key购买 nike

为什么当我运行“git remote show”时为什么会这样说

  HEAD branch (remote HEAD is ambiguous, may be one of the following):
dev
master
Remote branches:
dev tracked
master tracked

为什么 git 不知道远程 HEAD 分支?

最佳答案

因为 remote/HEAD 的 SHA1 引用与 remote/masterremote/dev 相同。

您可以在“Error with git: remote HEAD is ambiguous, may be one of the following”找到更多详细信息。

如本more recent thread所述(2011):

Right. The transport protocol doesn't expose the name that a symbolic reference points to, only its current value. Thus clients are forced to guess by looking for another reference whose current SHA-1 is the same. If there is more than one, its taking a best guess.

There have been a few attempts to expand the protocol and include the current symbolic reference target name, but thus far it hasn't gotten much beyond the idea stage.

A patch has been proposed虽然(但仅作为“本地存储库的快速补丁”)。

关于git - 为什么 'git remote show <name>'显示remote HEAD不明确,可能是以下之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13061364/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com