How to Add an SVN External Library To Another SVN Code Repository

Another self reminder (memo!) for the Subversion. Let’s say that you got two different code bases that are dependent to each other. What you need is to version them differently but you also want to development to work as smooth as possible using the cutting edge version (saying trunk).

What you need is to define an svn externals property to your current base:

svn propset svn:externals 'XXX' .

The trick is to use the single quotes and the dot in the end. As you are setting a property, any space you will put will break the setting. You have to put a dot at the end to indicate that you are changing the properties of the current folder.

This way you are adding a folder named XXX which is linked to the code repository’s XXX folder. Every time you use “svn up” both the code bases will be updated. Every time you commit, only the current repository will be committed. And if you need to commit to the external library, go to that folder, and when you commit external’s library will be committed too!

I’m sure that I will be forgetting the command again, so this way I know where to look.