subversion, git, subgit & Windows

On client-side we’re currently working with subversion, which is a (serious) pain. On top we have Windows7 machines. To deal with the first problem, I used git-svn for quite some time and in combination with Sourcetree it worked quite well. When I came back from my xmas break last week, the subversion structure was changed drastically and git-svn didn’t work anymore. It couldn’t clone the new repository and died after hours of trying with weird error messages. As I wanted to try out subgit (“git mirror for svn”) for quite some time, I didn’t really dive into the git-svn problems but gave subgit a go for evaluation :)

First thing to do is quite obvious: Download and install subgit.
Afterwards you have to configure the repository you want to clone:

subgit configure --svn-url $YOUR_SVN_URL $DESTINATION

I also made some tiny changes to the $DESTINATION/subgit/config file. I enabled httpSpooling (httpSpooling = true) to avoid timeouts and added the following lines at the end of the file:

[translate]
    eols=false

(More about line endings? -> Mind the end of your line)

Next, set your credentials within $DESTINATION/subgit/passwd. Careful: The (unlimited) evaluation version of subgit stores the passwords in plaintext.
Finally, tell subgit to “initialize” the project and start the demon – this might take some time, e.g. for me it took 9h:

subgit install $DESTINATION

Now you’re ready to use whatever git client you like to clone the repository from $DESTINATION and treat it like every other git repos you’re working with. Subgit is dealing with all the annoying svn stuff.
What I still need to test is good the branching and merging “translation” works.

If subgit is running on your dev system, you have to restart the demon by executing the install command again.

A small hint: If you want to use git 2.x on your Windows machine, you won’t find an official download for it yet. The current latest Windows version is 1.9.5. But you can install cygwin with git 2.x and simply add the $CYGWIN_DIR/bin to the Windows $PATH, as Cygwin provides you with a git.exe :P