Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you deploy from svn when your original repository is in Git

Tags:

git

svn

My team develops using Git, making good use of many of its features. We are measurably more efficient at using git that svn.

However our current client want us to deploy code from an svn repository, which means we are required to somehow regularly move our code from git to svn.

At the moment we are maintaining a directory that is both a svn checkout, and a git repo (contains a .git and so on) and we can then do git pull; svn commit

Of course, the process is a bit more complex, as we want to use tags for recording release points, and there is an overhead of running svn add on the files that have been created by git.

What is the best way to do this?

Is git-svn going to help this problem? I have never seen it used other than to allow one individual developer to use git tools locally, when using an SVN repo. I have no idea how well it would work with multiple developers working on multiple branches....

like image 835
Laurie Young Avatar asked Jan 27 '09 13:01

Laurie Young


1 Answers

If one person is deemed the integrator of all code for SVN, and you know no one else is contributing to the SVN repo, you could have him use git-svn to push changes:

  1. Integrator uses his master as a tracking branch for svn (e.g. git svn clone $REPO). He never does work on this branch
  2. Developers work as normal (presumably on topic branches, with a few mainline integration branches)
  3. When you want to do a release, integrator pulls all developer code to his main branch (not master, but something like integration)
  4. Integrator does whatever is needed to ensure release is good to go
  5. Integrator merges integration with his master
  6. Integrator does git svn dcommit

If others are contributing to SVN, you could still do it this way, but the integrator would have to regularly pull from SVN and make those changes available to devs so as to avoid merge conflicts.

At any rate, getting the code into SVN without a lot of hassle is the main issue. You can tag and branch in SVN without a local checkout so the integrator could do tagging (not sure if git svn will send tags to SVN or not)

like image 141
davetron5000 Avatar answered Oct 20 '22 22:10

davetron5000