At work, we currently use Subversion for SCM. I have set up a local git-svn mirror and use that as my primary development workspace. I am comfortable with the basic functionality now. One other developer in the team also wants to move to Git, so we are considering using a git mirror of the svn repository. I would also like to try Gerrit alongside this exercise.
The setup I imagine is something along these lines:
-
A git mirror for the svn repository. The master branch on this is in sync with the trunk on svn.
-
For each feature a topic branch is created. This is tied to Gerrit, on which the review happens. Once the changeset is approved, Gerrit merges the topic branch back master.
-
A gitweb, or similar, web application to view the repository on the browser.
-
A similar process for other branches on subversion besides trunk.
Essentially, what I want is that I interact only with my local git clone and the Gerrit webapp; pushing the reviewed changes back to svn should happen automatically. How do I go about setting up something like this?
It’s possible to setup a Git mirror that be in sync with the repository SVN
Install SubGit into your SVN repository:
Then just setup access to the linked Git repository created (path/to/svn/repository/.git) using Apache or whatever. Every push to that Git repository will be translated to an SVN revision and vice versa.
So you may use the linked Git repository in Gerrit and for you team (as if SVN never existed). After that you may shutdown SVN repository (or continue using). To stop synchronization before shutting down run: