0

I am trying to clone each of a project in an SVN repository with the following structure:

hcp
   branches
   tags
   trunk
       project1
       project2
       project3
          ..
       project50

The eventual goal is to create a separate repository for each project in git. In the SVN repository, the branches of project1 to project50 are all in branches and the tags of projects 1 to project50 are all in tags.

This is what I am using in my command to clone project1.

git svn clone --trunk=hcp/trunk/project1 \
    --branches=hcp/branches \
    --tags=hcp/tags \
    --authors-file=authors.txt   http://mysvn/svn/repo/hcp/trunk/project1  project1

but it is giving the error below:

Initialized empty Git repository in /home/jira3/hcp_migration/project1/.git/
Using higher level of URL: http://mysvn/svn/repo/hcp/trunk/project1 =\> http://mysvn/svn/repo
W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: File not found: revision 100, path '/hcp/trunk/project1/hcp'

and nothing is displayed when I run the command git tag or git branch.

What would be the correct command?

1 Answer 1

0

You merely specified the wrong URL - you need to use the repo URL, not the trunk URL:

git svn clone \
 --trunk=hcp/trunk/project1 \
 --branches=hcp/branches \
 --tags=hcp/tags \
 --authors-file=authors.txt \
 http://mysvn/svn/repo \
 project1

I assume that the structure below each subdirectory of hcp/branches and hcp/tags is the same hcp/trunk/project1 at least for the branches/tags of project1. I suspect you might get a lot of junk branches and tags, though, if they aren't skipped automatically.

4
  • Tried the command using the repo URL as suggested but it did not work. It seems to be going into an endless loop and it has not completed since started a day ago.
    – John
    Commented Jul 26, 2024 at 11:48
  • You have to look at the outputs in detail to tell whether it is in a loop or not. Does it repeat revision numbers? How many revisions are there? Commented Jul 26, 2024 at 11:50
  • Looking closely at the output as you suggested, you are right that it is not in a loop. There are 35041 revisions, about 600 tags for the different projects ( 104 total) under the tags , so the sheer number of projects is just too much to do it this way. We'll probably just import the whole hcp project in git to have the history and just create a separate repository in git for each project as we work on them. Thank you Bernhard for your help.
    – John
    Commented Jul 30, 2024 at 13:37
  • 35k doesn't sound all that bad... I suspected something in the millions. Maybe pre-filtering with svndumpfilter once per project would already help you. There's also a tool called svndumptransformer which might be useful for restructuring the directory structure, but I have no experience with it. Commented Jul 31, 2024 at 14:41

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.