tags:

views:

145

answers:

3

At work we keep all out clients projects in subversion repositories and are not going to change this in the foreseeable future. A lot of our projects use the same plugins/modules and we also open source some of these and share them on our own github accounts.

What I'd like to do is:

  1. Maintain a client project with all the code in subversion
  2. Any dev add plugins / modules from any remote / github repo to the project
  3. Any dev be able to pull changes made to the github repos and add them to the project's svn repo (on a project by project basis, not all at once)
  4. Be able to make project specific tweaks to the code pulled from the github repos that are not to be pushed back to github or impact the ability to pull changes from github
  5. Devs with required ssh keys can push local changes to the code on github back up to github so any bug fixes or new features that would be of benefit to all projects using the plugin / module can pull them down too.

Is this possible? If so, how?

Can I do this with a combination of:

  1. vendor branching in the svn repos with a vendor for each of the external github repos to keep the separation of the re-usable code on github and the tweaked code for the project.
  2. committing the .git folder into the vendor branch in the svn repo to enable anyone to pull the latest changes.
A: 

I believe that most of what you're asking for is possible using git-svn (http://git.or.cz/course/svn.html) which allows you to layer git on top of subversion. You can push back into the svn repository when you feel it is a good time and between that use git in a normal git fashion.

stimms
What about the vendor branching thing? Do you know if you can achieve that kind of thing with git-svn?
neilcrookes
A: 

There should be no problem combining .git and .svn repositories in the way you suggest.

I recommend adding .svn to the .gitignore file for each git repo used in this way.

You need a strategy for preventing private changes going upstream to the git hub. For instance, keep all of these in a separate branch that you can do a reverse rebase merge from just before upload, and then revert it.

Alex Brown
+2  A: 

Rather amusingly, github added Subversion support as a non-April-Fools' joke. In other words, it looked like an April Fools' joke, but is fully functional!

You can add a git repository as an svn:externals using the Subversion URL http://svn.github.com/USER/PROJECT.git.

rq