Search code examples
gitsvnmigrationrepositorygit-svn

Git SVN init doesn't get full repository


I am trying to migrate our SVN repository to Git. Our SVN repository looks like this:

Repository name
   ->branches
       ->file1
       ->file2
       ->etc...
   ->trunk
       ->otherfile1
       ->otherfile2
       ->etc...

I initialize the repository likes this git svn init svn://example.com/project --stdlayout --no-metadata After that git svn fetch. When everything finishes it looks likes it fetches just elements from the trunk - otherfile1, otherfile2 and etc...

Problem is that I want to get the same folder structure as is was in our SVN repository and not just files from trunk. Is it possible to do that?

Thank you in advance


Solution

  • While it might technically be feasable, it is not the recommended good practice.
    SVN consider everything as folder (including branches), while Git uses branches as first-class citizen, allowing you to switch quickly between branches.

    It you need to see multiple branches from one Git repository, you will use git worktree to checkout multiple branches in their own folders.