svnsymlink

Can I keep a symbolic link in my Subversion repository?


I'm developing a small app in both PHP and Java. It has a few pics, CSS and JS, that must be shared in both.

I don't want these files duplicated, and the JS and CSS must be the same in both. So I'd like that when I change it in one place, the change be replicated in the other.

In Unix we have symbolic links, so that the same file/folder can "be" in multiple places in File System. In Subversion we have svn copy, but once it's executed both copies become independent. I wanted to keep them together, a commit done in one copy will be applied in the "other" too.

Any idea how to do that?


Solution

  • You're referring to symlinks in your post, not "shadow links" (I've edited the post). Subversion can version symlinks, but another way to go about it (as symlinks aren't supported by Subversion on Windows at the moment) is to use Externals.

    The difference is that if you use a Subversion external, you'll actually have two copies of the file on your system (which point back to the same place in the repository), whereas the symlink is a single file on the filesystem.