3

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:

root
--project1
--project2
--shared
--smtp

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.

6 Answers 6

11

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.

2

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.

0

This is what svn "Externals" are for.

0

Yes, have a look at SVN Externals.

1
  • jamuraa clearly has a better, direct, answer though. Upvoted that one.
    – Jilles
    Nov 1, 2008 at 16:23
0

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

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.