Using Visual SourceSafe – Share

This article is a part of SourceSafe / VSS Tutorial

In version control, Share enables files to be shared among multiple projects. It creates share links among these projects, so that the item can be viewed in all projects. If an item is modified in one project, the changes will be reflected in other projects simultaneously.

To use the Share command, we must have the Check Out/Check In right in the project we are sharing from, and the Add/Rename/Delete right in the project to which we are sharing.


Why Share

Consider a scenario in which your team develops several projects at the same time, and they all use one header file named common.h. You can share common.h in all projects. That way, any change made to common.h in one project is immediately propagated to all other projects. The file in all projects will always keep the same content.

If we do not use the Share command, we may need to copy the shared files to other projects. This will cause a problem: We need to synchronize the file manually every time we make changes to the file.

Now we can understand Share better. Share command enables files to be viewed/ modified in multiple projects at the same time.


How to Share file(s)

To share an item, we can use Share command on the Versions menu.

  1. In Visual SourceSafe Explorer, select a project to share the file(s) to.
  2. On the Versions menu, click Share to.
  3. In the Share to dialog, choose the project from which you want to share the file(s) in the Projects box, and then select files in the File to share box. You can check the Branch after share option if you need to branch the file(s).

    Share Using Versions Menu
    (Share using Versions menu)


  4. Click Share to share the selected file.


However, there is an easier way to perform the Share command. We can Share the file(s) using drag-and-drop:

  1. In Visual SourceSafe Explorer, right-click an item.
  2. Drag the item over the receiving project and drop the item.
  3. In the resulting menu, click Share.

Share using drag and drop
(Share using drag and drop)



How to Find the Share Links

After we shared the file(s), we may want to know which projects the file(s) are shared in. In Visual SourceSafe explorer, we can right-click on a shared file and click Properties -> Links tab, thus all share links for the selected file will be displayed. A share link is a Visual SourceSafe path to a project that shares the file with other projects.

Share links
(Share links)



How Project Share is performed in VSS

According to the Visual SourceSafe help file, VSS supports file and recursive project sharing. This makes Share in VSS very convenient and efficient.

However, please be advised that VSS does not truly share projects. Instead of sharing project structure, VSS shares project through sharing all of its subsidiary files (recursively). So, if we change the project structure by adding or deleting a file, the change will not be reflected in other shared projects.

Share needs to be combined with Branch to play a greater role. We will go into details of Branch in my blog later. Please continue to pay attention.


SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Previous article <<<<: Project Diff in SourceSafe / VSS
Next article >>>>: Branch in SourceSafe / VSS
SourceSafe How To series home page: VSS / SourceSafe Tutorial

11 thoughts on “Using Visual SourceSafe – Share

  1. For your requirement you can use share and branch. Please check the detailed steps below:
    1. Open Visual SourceSafe Explorer, select the parent project of project “version2″.
    2. On the Versions menu, click Share to.
    3. In the Share to dialog, choose the project “version1″ in the Projects box. You can check the “Branch after share” option to break the links between the 2 versions.
    4. Click Share and then set the New name as “version2″, check Recursive to share the whole project “version1″.
    5. Click OK to start share.

  2. Hi, i am developing a product in which has multiple versions. Now version1 development is finished. Now we need to version2. So i need to create new project (Version2) and copy all files from version1 into version2.

    Can anyone help me how to do this in VSS?

  3. To delete a share once one is created, delete the file from the location you no longer want to share to. Make sure to check the Destroy Permanently, or the link will remain.

  4. Very nice article.

    But still now I have a question : How to share files two different projects (in different roots).

    With Regards
    PK Jena

  5. To delete the share, you need to go to the destination directory in VSS and delete the shared file from there.

  6. I have the same question as Steve.. how on earth do you delete a share ?
    if anyone knows, please post it!.. thanks!

  7. Nice article.
    How do you delete an existing share (supposing one has been set up in error)?


Comments are closed.