I just found out Howto use Git and svn together, by Flavio Castelli. In there, he lists the steps he uses to develop using Git, but keeping a Subversion repository in the loop.

In his Solve git-svn rebase problems section, Flavio uses git-stash to workaround git-svn rebase problems when your tree has local modifications. I use a different solution. I develop locally on a branch and never commit directly on master. This way I can git-svn rebase with impunity. When I’m ready to merge, I’ll git-svn rebase, followed by git checkout my-branch, git rebase master (to freshen my changes with the remote repository), and finally, I’ll git merge onto master. The steps:

 1 git checkout -b francois
 2 # work and commit locally on branch francois
 3 git checkout master
 4 git svn rebase
 5 git checkout francois
 6 git rebase master
 7 # run the tests!
 8 git checkout master
 9 git merge francois # I might use --squash if the new feature warrants it
10 git svn dcommit # push to Subversion

Overall, my experience with this workflow has been great. I can the features of each system to it’s fullest advantage. I can be on the road, still Gittin’ it done, and the rest of the team still uses Subversion. This is a great combination!

Thanks to Jean-François Couture for showing me the light.


Your Host

A picture of me

I am François Beausoleil, a Ruby on Rails and Scala developer. During the day, I work on Seevibes, a platform to measure social interactions related to TV shows. At night, I am interested many things. Read my biography.

Top Tags

Books I read and recommend


Projects I work on

Projects I worked on