Search code examples
gitsvnsvn2git

svn2git command failed: git checkout


Currently we're experimenting with migrating some of our bigger projects from svn to git. svn2git worked quite nice for some of our projects, but it has problems with our bigger ones. At the end we will get the message:

command failed:
git checkout OldBranch 1

We also know why we get the message. It's because we didn't delete a lot of our branches, instead we moved them to a DEPRECATED folder. Our svn structure basically looks like this:

|-OurProject
| \- trunk
| \- tags
| \- branches
| | \- DEPRECATED
| | | \- OldBranch 1
| | | \- OldBranch 2
| | | \- OldBranch 3
| | \- Branch 1
| | \- Branch 2
| | \- Branch 3

The error message always shows to a branch inside the deprecated folder, so I guess svn2git really doesn't like that sub folder.

What we've tried:

  • Use the --exclude parameter to ignore everything inside the DEPRECATED folder, but with no luck. We've used several different ways to exclude the folder:

--exclude DEPRECATED
--exclude .*DEPRECATED.*
--exclude .DEPRECATED.

  • Delete the DEPRECATED folder completely, but it still tries to find the old branch.
  • Use the --nobranches parameter. That works, but we really would love to migrated our current branches, too.

Anyone who had the same problem and found a solution?


Solution

  • We were not able to configure it. At the end we just used subgit, this tool was able to import the DEPRECATED folder as a branch which just had all the deprecated branches in it.