Sharing Files in SVN

svn
12,714

Solution 1

Is svn:externals what you're after? http://svnbook.red-bean.com/en/1.0/ch07s03.html

Solution 2

I second Rick on this. To me, the whole concept of "sharing" (= having the same file occur in two places at checkouts) is weird.

I guess each versioning system has its own mindset implicitly attached to it. I've tried Perforce and I've stayed with Subversion. Bringing your projects to it without changing the mindset and maybe workflow may be flawed, though.

The Book on svn is a worthy read, to get some of the mindset submerged before doing the plunge. You can select some sections only, you don't have to read all at once.

Solution 3

We had the same problem. The simple answer is that you can't share files in SVN - in the end we had to restructure our directories and use batch files.

e.g. for source code files that were shared, we moved them to an Include folder, and have all the projects reference that folder.

For binary files that need to be copied to more than one location we store them just once in SVN, and then use batch files to copy them across to the target locations on each developers machine (or also on the build machine).

Share:
12,714
Arry
Author by

Arry

Updated on August 17, 2022

Comments

  • Arry
    Arry over 1 year

    I am in the process of moving from VSS to SVN and I'm not sure how to share files in SVN.

    Basically we have the following structure in VSS

    $MOSS
      - Components
        - ComponentA
          - bin
        - ComponentB
          - bin
      - GAC Mirror
    

    GAC Mirror holds a shared copy of all the Dlls from the bin folders of the components to allow for easy copying to the GAC.

    In VSS all you do is drag the Dll from the bin folder to the GAC Mirror folder and it works it's life out.

    How would I do this in SVN?

    Thanks in advance.

  • Arry
    Arry over 15 years
    I'm in the process of selling the move to SVN and this will not help my cause, sod.
  • Arry
    Arry over 15 years
    Can I link several folders to one doing this?
  • RickL
    RickL over 15 years
    It was still worthwhile for us to make the change because SVN is faster, more robust, has better support for offsite users. Perhaps you should try and emphasise the other good points. Also the optimistic commit strategy improves productivity (versus the locked file checkin/checkout of VSS).
  • Sprogz
    Sprogz over 15 years
    It doesn't look like it :( I just tried setting up two different SVN projects as externals in my "main" project's shared folder and only the second external referenced project was copied down.
  • Arry
    Arry over 15 years
    I only need it to work in one direction and thus this is perfect for me. I guess I am copying rather than sharing in VSS.
  • mistertodd
    mistertodd over 11 years
    Sharing isn't specifically a "versioning system" concept. i want the exact same file to exist in multiple places. In the days before source control we would have to continuously copy changes back and forth. It would be preferable that the files are kept in sync automatically, with one set of revision history (since there is only one set of revision histories)