11
Nov 09
0

Tortoise, Windows and svn2git

If you have been thinking about making the switch from Subversion to Git, now is the time! svn2git is a great tool to make your transition much easier. It will import an existing Subversion repository into Git while maintaining all of your change history. It will even create branches and tags in your Git repository that match those from your Subversion repository. Check the readme to get started.

You may want to start the conversion on a weekend as it does take some time to complete. It took overnight to complete the conversion of a 300mb Subversion repository with roughly 6000 commits and 30 branches.

If you are running Windows, I’m guessing you are using TortoiseSVN, and you will probably want to use TortoiseGit. It is very similar to TortoiseSVN so you should not have any trouble adjusting assuming you understand the basic workflows of Git. One important thing to note is you will want the AutoCRLF setting set to true in your Git config. TortoiseGit can help you set this setting in the Settings -> Git -> Config dialog. You’ll see a checkbox labeled AutoCrlf and odds are it is already checked. Unfortunately, this checkbox is not guaranteed to be an accurate reflection of the real setting, so open up projectroot/.git/config in a text editor and add autocrlf = true underneath the [core] section if it is not there.

One last tip on the conversion, follow these instructions from Github if you experience problems with files marked as modified when they do not appear to be.

The problem is that your core.autocrlf option is likely not enabled. This setting tells git to convert the newlines to the system’s standard when checking out files, and to LF newlines when committing in. Once this is set, you need to reset your repos. The best way to do this is wipe out your working tree (all the files except the .git directory) and then restore them.

Good luck with your transition.

Tagged: ,  

Leave a comment

(required)

(not published) (required)