Take the 2-minute tour ×

I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question...

I have a number of shared projects - code that I want to use with lots of different projects. Is it possible to 'link' these shared folders to the projects that need them, so checking out a project will also checkout the shared code?

For example, suppose my repository looks like this:


When I checkout project1, I also want to checkout shared and smtp.

Back in my CVS days I would of used a Unix symbolic link in one of the project folders, but as my new SVN repository won't necessarily be hosted on a Unix box, I can't do the same.

share|improve this question
add comment

6 Answers

up vote 11 down vote accepted

SVN Externals are what you want to do. The SVN book explains it in great detail here. That's one thing I love about SVN, the wonderful documentation.

share|improve this answer
add comment

You are looking for the "svn:externals" property. See this section of svnbook:

Under the project that you want to use the shared project in, and then set a property on that directory named "svn:externals". This property contains the name of the directory which contains the external respository, and can have some other options so that you always get the same revision.

Example (from svnbook, which is an EXCELLENT reference for svn questions):

$ svn propget svn:externals calc
third-party/sounds             http://svn.example.com/repos/sounds
third-party/skins -r148        http://svn.example.com/skinproj
third-party/skins/toolkit -r21 http://svn.example.com/skin-maker

in this example, third-party/sounds would be checked out from http://svn.example.com/repos/sounds. The -rNNN pins the checkout to a revision so that if you're doing more development on that, you can make sure your other projects don't randomly break. Generally instead of doing this revision thing, I external to a tag which holds a stable version.

share|improve this answer
add comment

This is what svn "Externals" are for.

share|improve this answer
add comment

Yes, have a look at SVN Externals.

share|improve this answer
4 identical answers in the space of 14 seconds. Not bad... –  Dan Dyer Sep 17 '08 at 21:30
Yep, and the third one accepted :) –  Sunny Milenov Sep 17 '08 at 21:32
jamuraa clearly has a better, direct, answer though. Upvoted that one. –  Jilles Nov 1 '08 at 16:23
add comment

Yes, this mechanism is called "externals". See the book.

share|improve this answer
add comment

SVN has a feature called "externals" which basically works the same way a symbolic UNIX link works (you point a certain directory that's one place in your repository to some other directory elsewhere in your repository).

For further info on how to setup externals, see this: http://svnbook.red-bean.com/en/1.0/ch07s03.html

Hope that helps.

share|improve this answer
add comment

Your Answer


