Reputation: 9781
I try to clone a svn repo to git, but some of the branches are in the svn root dir like follows.
I've tried
$ git clone svn://url/svn-root -T trunk -b branches -b branch1 -b branch2
and
$ git clone svn://url/svn-root -T trunk -b branches -b .
Both are failed to clone the branch1
and branch2
correctly. Please help.
svn-root
├── branch1
├── branch2
├── branches
│ ├── branch3
│ └── branch4
└── trunk
Upvotes: 5
Views: 670
Reputation: 1323793
One interesting tool, mentioned in GitMinutes Episode 20, is SubGit, a plugin for Atalssian Stash (which isn't free, but you can try it for free).
You can know much more about SubGit in "GitMinutes #22: Alexander Kitaev about SubGit".
It is designed to managed unconventional svn repo layout.
you should enter in the "Branches" field:
*:refs/heads/*;branches/*:refs/heads/branches/*
# instead of
branches/*
In this case
branch1
will be translated torefs/heads/branch1
,
branch3
--- torefs/heads/branches/branch3
.Alternatively, if you have limited number of top-level branches, you can enumerate them explicitly:
branch1:refs/heads/branch1;
branch2:refs/heads/branch2;
branches/*:refs/heads/branches/*
Upvotes: 6
Reputation: 491
Two options come to mind:
Upvotes: 0