December 21, 2015

SVN Externals

I know that subversion is somehow out of fashion. However, svn has some benefits, as you can control access to individual directories quite easily.

Today I asked myself if it is possible to combine contents of one svn with contents of the other. Or, to put it differently, to kind of “mount” one SVN into the other. The answer are svn externals.

As the documentation is a little crappy, I want to write down what I found out.

We have two SVNs: http://server/svn1 and http://server/svn2. svn1 is already checked out to some path. cd to this path (you should be in the root of SNV1 now). Type

svn propset svn:externals "http://server/svn2 svn2" .
svn ci -m "added some external"
svn co

Now you should have the contents of http://server/svn2 in the svn2 folder. Neat. One tiny drawback: the external is not visible when you are visiting the svn with a web browser.

How to get rid of that?

svn propset svn:externals "" .
svn ci -m "removed some external"
svn co

© ho1ger 2015 - 2022