Question

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!

Was it helpful?

Solution 3

Thank you for your answers, svick and Damien! They are both good, but as I cannot accept them both, I'm going to some up the whole thing in my own answer.


So, basically, one could have a git repository with read-only svn-access to it. As Damien said,

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.

Another way to get read-only access to the code in any repository is to have an archive with the latest snapshot of the source code stored somewhere on your server and available for download.


If there is a need for some users to make changes in the code, the only appropriate way to save them would be to commit them back into the repo, no matter what SCM is used. In this case, if the user who has made a change doesn't know how to commit, there should be a programmer (responsible for the source code) who will gladly review the change and commit it back into the repo.

OTHER TIPS

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).

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top