Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn-checkout from a GIT repository

Is there a way to make an svn-checkout from a git repository?

The problem is that I'd like to have a git repository stored on a server and I can work within using git normally, pushing and pulling changes.

However, there are developers, who don't need to make changes in the code, but they need to be able to fetch the latest snapshot of the source code and build it on their machine. Those so called "developers" would really like to use SVN as it an SCM they're already familiar with.

So, is there a way to setup such scenario? Or is this the only possible way -- to use an SVN repository and work with it using git-svn if I want git for myself and SVN for the rest of my colleagues?

Thanks!

like image 367
Alexei Sholik Avatar asked Jan 11 '11 19:01

Alexei Sholik


2 Answers

If you want to checkout a repository using SVN, you have to have an SVN repository, unsurprisingly. Without that, it would be hard to keep track of the things that don't translate nicely between SVN and git (e.g. revision number, branches).

But what you are asking for doesn't really seem like a repository, you just need to synchronize a folder. For that, other tools than SVN are probably better suited, e.g. rsync. Another possibility is to have an always up-to-date archive containing the source code (for example Github provides this).

like image 193
svick Avatar answered Oct 01 '22 14:10

svick


Using an SVN repo through git-svn for you would work, but if there are other people that like git, you will lose the benefits of collaborating with git. That's what I use at work where SVN is the de facto standard and I just prefer git's commands and better log display. We mostly use SVN as an archiving tool anyway: no branches, and we synchronize in real life to collaborate on a single document.

Another solution would be to make the official repo a git one, and automatically push to a slave svn repo using git-svn, either with cron or in a post-commit hook. This seems the best one if as you say, the svn users will never need to commit.

like image 34
Damien Pollet Avatar answered Oct 01 '22 12:10

Damien Pollet