GIT含糊不清的名字? [英] Ambiguous Names with GIT?
问题描述
我试图查看一个名为TEAM20-lab2-release的本地分支。当我尝试这样做时,我得到一个模糊的refname错误:
$ git分支TEAM20-lab2-release
警告:refname'TEAM20-lab1-release'不明确。
致命的:模棱两可的对象名称:'TEAM20-lab1-release'。
以下是我的分行列表:
$ git branch -a
TEAM20-lab1
* TEAM20-lab1-release
master
remotes / origin / HEAD - > origin / master
remotes / origin / master
通常是因为您的在另一个命名空间中使用了相同的名称(比您的分支): 2016年更新:如果分支和标签共享相同的名称,则Git 2.12(2017年第1季度)不会显示任何错误。 请参阅以丹尼斯提交b284495 (2016年10月31日) Kaarsemaker( 当用户执行懒惰的 分支名称(例如 一个完整的refname作为源端以避免 I'm trying to check out one of my local branches, named TEAM20-lab2-release. When I try to do this, I get an ambiguous refname error: Here is the list of my branches:
It usually is because you have the same name (than your branch) used in another namespace: Update 2016: Git 2.12 (Q1 2017) won't show any error if a branch and a tag are sharing the same name. See commit b284495 (31 Oct 2016) by Dennis Kaarsemaker ( When the user does the lazy " However, the branch name (say " Be explicit and give a full refname as the source side to avoid the
ambiguity.
这篇关于GIT含糊不清的名字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
(因此davitenio在 git branch -a
中的请求)
seveas
)。结果,
见提交eef2bda (2016年10月28日)由 JUNIOç滨野( gitster
)。
(由 JUNIOç滨野 - gitster
- 在 = https://github.com/git/git/commit/6c18dd4dc370284417938a252ba7f1a36ad51053 相对= nofollow noreferrer>提交6c18dd4 ,2016年12月27日)
/ code>:不要使用潜在的不明确的默认refspec
git push
,没有 push.de参数错误
设置为上游
,简单
或 current
,我们在内部生成了一个refspec,它在源端具有当前分支名称并用它来推送。
test
)可能是
中一个不明确的refname,源代码仓库的上下文---可能有一个带有$ b的标签$ b同名,例如。
这会触发一个不必要的错误,而不会在最终用户身上发生任何错误。
模糊。
使用 current
>推送时的目标端只发送名称并迫使接收端进行猜测,这是同样的问题。
请在此处明确指出。
$ git branch TEAM20-lab2-release
warning: refname 'TEAM20-lab1-release' is ambiguous.
fatal: Ambiguous object name: 'TEAM20-lab1-release'.
$ git branch -a
TEAM20-lab1
* TEAM20-lab1-release
master
remotes/origin/HEAD -> origin/master
remotes/origin/master
(Hence davitenio's request for git branch -a
in the comments)
seveas
).
See commit eef2bda (28 Oct 2016) by Junio C Hamano (gitster
).
(Merged by Junio C Hamano -- gitster
-- in commit 6c18dd4, 27 Dec 2016)
push
: do not use potentially ambiguous default refspecgit push
" with no parameters with push.default
set to either "upstream
", "simple
" or "current
", we internally generated a refspec that has the current branch name on the source side and used it to push.test
") may be an ambiguous refname in
the context of the source repository --- there may be a tag with the
same name, for example.
This would trigger an unnecessary error without any fault on the end-user's side.
The destination side when pushing with the "current
" sent only the name of the branch and forcing the receiving end to guess, which is the same issue.
Be explicit there as well.