Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use git repos inside svn repos

Tags:

git

svn

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.
like image 350
neilcrookes Avatar asked Jan 28 '10 16:01

neilcrookes


People also ask

Can I use git with a SVN repository?

The git-svn tool is an interface between a local Git repository and a remote SVN repository. Git-svn lets developers write code and create commits locally with Git, then push them up to a central SVN repository with svn commit-style behavior.

Is SVN easier than git?

SVN has one central repository – which makes it easier for managers to have more of a top down approach to control, security, permissions, mirrors and dumps. Additionally, many say SVN is easier to use than Git.

What is difference between SVN and git repository?

Git has a Distributed Model. SVN has a Centralized Model. In git every user has their own copy of code on their local like their own branch. In SVN there is central repository has working copy that also make changes and committed in central repository.


2 Answers

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://github.com/USER/PROJECT.

like image 198
richq Avatar answered Sep 19 '22 11:09

richq


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.

like image 37
stimms Avatar answered Sep 22 '22 11:09

stimms