几周前,我将一个 Subversion 存储库转换为 Git。我留下了一堆我不再需要但无法删除的分支。更糟糕的是,在试图摆脱 svn/whatever 分支的过程中,我现在发现自己的分支“原点”重复。这是我的分支列表的片段:
% git branch -a | egrep 'svn/partial|master'
* master
origin/master
origin/origin/master
svn/partial
remotes/origin/master
remotes/origin/origin/master
remotes/svn/partial
我似乎能够删除 svn/partial 分支,但不能删除 remotes/svn/partial 分支:
% git branch -D svn/partial
Deleted branch svn/partial (was 373a64c).
% git branch -D remotes/svn/partial
error: branch 'remotes/svn/partial' not found.
如果我 git-fetch,svn/partial 被重新创建,我得到另一层“origin/”分支:
% git push
Everything up-to-date
% git fetch
From .
...
* [new branch] origin/origin/origin/master -> origin/origin/origin/master
...
* [new branch] svn/partial -> svn/partial
哎呀!它们像 tribbles 一样繁殖:
% git br -a | egrep 'svn/partial|master'
* master
origin/master
origin/origin/master
origin/origin/origin/master
svn/partial
remotes/origin/master
remotes/origin/origin/master
remotes/origin/origin/origin/master
remotes/svn/partial
我该如何解决?