Based on some other answers to this question, I came up with a Ruby script that handles the movement of git-svn. You can find it at https://gist.github.com/henderea/6e779b66be3580c9a584 .
It handles the move without checking another copy, and even handles the case when undefined changes occur in one or more branches (since this violates the regular logic). It uses material from the responder to the git filter responder (for the main logic) and the answer about copying branches from one repo instance to another (for copying branches with inaccurate changes).
I used this to move the bunch of git-svn repos that I have to work, and this version of the script (I went through countless iterations) seems to work for me. It is not very fast, but it seems to cope with all the cases that I encountered, and as a result of a completely reorganized repo.
The script gives you the option to create a copy of the repo before making any changes, so you can use this option to create a backup. Creating a copy is required if you have unspecified changes in any branches.
The script does not use any stones or other libraries that are not included in a typical Ruby MRI installation. It uses the readline and fileutils libraries included in the MRI.
Hope my script will prove useful to someone else. Feel free to make changes to the script.
NOTE. I tested only this script with git 2.3.0 / 2.3.1 and Ruby 2.2.0 on OS X 10.10 Yosemite (since I use the environment), but I expect it to work in other environments as well. However, there are no guarantees regarding Windows.
Eric Henderson Feb 26 '15 at 17:03 2015-02-26 17:03
source share