1

How can I rename a branch in SVN through all revisions so that it looks like it always had the new name when checking the log?
I understand that there may be no SVN client command for this, but is there anything I could do on the server?

The reason for this is that I'd like to move to git and git-svn clone doesn't like a branch name like "Fix 1, 2 and 3" (I guess because of the comma).

Marc
  • 9,012
  • 13
  • 57
  • 72

2 Answers2

2

svn move last_branch new_branch

Tokytok
  • 298
  • 2
  • 6
  • 14
  • This is equivalent to `svn copy` + `svn delete`, so it won't do the trick for older versions. – malenkiy_scot May 22 '12 at 15:11
  • It won't affect, but as result will not have wrongly named Git reference. Just tried with git-svn and SmartGit: both work with the resulting repository. And this approach is less danerous. – Dmitry Pavlenko May 22 '12 at 15:21
  • This was also my first idea and I even did this too. However, when running git-svn clone, the older revisions will still use the old name 'last_branch' thus the errors would still be there. So I don't see the benefit in this. – Marc May 22 '12 at 20:23
0

To do that you may use "svnadmin dump" + edit dump (with own script or have a look at svndumptool.py) + "svnadmin load" combination. But this approach is not recommended, because you can get broken svn:mergeinfo and potentially may corrupt your repository.

So would also vote for "svn move" approach.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38