iteahaus

A/B code testing with git&svn

Using Subversion? Great, isn’t it? The plethora of tools—such as CruiseControl, Subclipse, Subversive, and trac—makes working with other people wonderfully productive, even with the usual trappings of group work.

But what if I’m not sure I want to commit? git to the rescue! It’s cheap and easy:

$ git init .
$ git add moneyhoney.js
$ git commit -m "backing up potential fix." moneyhoney.js
$ svn revert moneyhoney.js

This is our control subject. After running some confirmation tests…

Let’s grab our local backup copy of our experimental subject:

$ git checkout -- moneyhoney.js

If additional testing confirms that our fix is good, we commit for realz:

$ svn commit -m "soopa doopa fix, yo" moneyhoney.js