ypnos
ypnos

Reputation: 52337

Migrate SVN to git with cleanup

I want to migrate my project from SVN to git but I would like to have a clean history of all files and basically get rid of branches. A few of the issues I have:

When I use svn2git I end up with all kinds of branches (some "imported" from the other project) and the history of the trunk is not as helpful as it could be. What I would like to have instead is basically have the history of each single file (or directory which is cleaner) to be recovered while stripping all the moving around that took place. If the other branches that are still relevant are not preserved by this it doesn't particularly matter.

A related question to this is: From svn to git, with a moved trunk

I would be happy for any suggestions, e.g. do some magic in SVN before the migration, have a clever way of migration or "clean up" in git after the migration.

Upvotes: 0

Views: 658

Answers (1)

Sergey Azarkevich
Sergey Azarkevich

Reputation: 2671

1 Simple cases like #1 can be filtered by svndumpfilter

2 More complex cases can be solved by rewriting history. Though you should understand that this is complex and error prone process.

So, basically you should:

  • make dump
  • process it with Python + svndump lib as you want - remove nodes, replace nodes paths, rearrange revisions and so on.
  • load dump
  • compare (if need) old repository with new to be sure that history is not lost

If you want, I can provide python script examples.

Upvotes: 2

Related Questions