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.
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.
- In Visual SourceSafe Explorer, select a project to share the file(s) to.
- On the Versions menu, click Share to.
- 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)
- 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:
- In Visual SourceSafe Explorer, right-click an item.
- Drag the item over the receiving project and drop the item.
- In the resulting menu, click Share.
(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.
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.
The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement
The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft