警告:使用git-svn时,refname'xxx'不明确 [英] warning: refname 'xxx' is ambiguous when using git-svn
问题描述
我正在使用git作为Subversion的前端(通过git svn)。
I am using git as a frontend to Subversion (via git svn).
因此,对于每个svn主干/分支,我在git中都有一个名为 remotes的远程分支。 / xxx。例如, remotes / trunk, remotes / coolfeature。
So, for every svn trunk/branch I have remote branch in git named "remotes/xxx". For example "remotes/trunk", "remotes/coolfeature".
现在,我希望每个远程分支都有一个默认本地分支,以便将其用于dcommit。问题是我希望这样的分支以Subversion分支命名,例如 trunk, coolfeature,所以我在git中有以下分支:
Now I want have one "default" local branch for every remote branch, to use it for dcommit. The problem is that I want such branches to be named after Subversion branches, like "trunk", "coolfeature", so I have the following branches in git:
trunk
coolfeature
remotes/trunk
remotes/coolfeature
问题是每次我引用 trunk或 coolfeature时,git都会抱怨分支名称不明确。没什么大不了,但我感到不舒服。
The problem is that every time I reference "trunk" or "coolfeature" git complains branch name is ambiguous. Not a big deal, but I feel uncomfortable.
问题是,假设简单地重命名分支不是我想要做的,我该如何处理该警告。此类情况的最佳做法是什么?
The question is, how can I deal with that warning, assuming that simply renaming branches is not what I want to do. What are the best practices for such cases?
推荐答案
如果您通过-prefix = svn /
标记到 git svn clone
命令,那么所有Subversion分支将被命名为 remotes / svn / branchname
。如果这对您来说是可接受的,则它会修复 refname不明确警告。它还为您提供了一个引用远程svn分支的好方法,例如,如果您要创建本地跟踪分支,则类似于:
If you pass the --prefix=svn/
flag to the git svn clone
command, then all of the Subversion branches would be named like remotes/svn/branchname
. If this is acceptable to you, it fixes the "refname is ambiguous" warning. It also gives you a nice way of referring to the remote svn branches, as in for instance if you want to create a local tracking branch it would be something like:
$ git checkout -b branchname svn / branchname
本地分支的名称与远程svn分支的名称相同,并且没有模糊的refname问题。
The local branch then has the same name as the remote svn branch, and no ambiguous refname problem.
这篇关于警告:使用git-svn时,refname'xxx'不明确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!