If you haven’t heard of Git or don’t understand why you should use it, checkout the talk given by the author to Google (Torvalds, 2007). Git is an excellent version control tool for agile software development. But many of us may not have the luxury of using Git because our company has deemed that we shall use Subversion. Now Subversion is not a bad tool and has added some nice features in version 1.7. But my preference is to use Git.
It turns out there are a couple of tools that let you use Git and Subversion together. This can provide the best of both worlds by allowing you to use Git and your company to still have a master Subversion repository. The first tool is called git-svn, which actually comes with Git. The git-svn tool is designed to provide “bidirectional operation between a Subversion repository and git.” (git(1) Manual Page, n.d.)
With the git-svn tool you clone a Subversion repository into a local git repository. This gives you a history complete local working copy. Now you can work offline and use the benefits of Git for things like feature branching. This is great when working on an agile project. However, git-svn currently has one issue that deters me from using it – if you have multiple commits to your local git repository and you try to push those commits to the remote Subversion server and someone else commits to Subversion in the middle of your push then git-svn fails. There are workarounds for this, but it really annoying.
I recently ran across another tool that can be used for Git and Subversion integration called SubGit. According to the developers, “SubGit is a tool for smooth, stress-free Svn to Git migration.” (tmate, n.d.) The current stable version is designed to be installed on the same server as your Subversion and Git repositories and keep them in sync while you migrate.
However they also have an EAP version of SubGit that allows you to create a writable Git mirror of a remote Subversion repository! This was very easy to setup following their instructions. I have a remote Subversion repository setup on Unfuddle and was able to setup SubGit to handle the sync between it and a new Git mirror of it.
Why is this better than git-svn? Because all I have to do is clone the Git mirror of my Subversion repository and viola, I am working in pure git. I simply push to and pull from the Git mirror to my Git clone and let SubGit worry about syncing my Git repository and my Subversion repository. I’ve just started using this tool but so far I really like what they have done.
Torvalds, Linus. (May 3, 2007). Linus Torvalds on git. Retrieved from http://www.youtube.com/watch?v=4XpnKHJAok8
Git Manual Page. (n.d.) Retrieved from http://www.kernel.org/pub/software/scm/git/docs/
tmate software. (n.d.) Retrieved from http://subgit.com/index.html