|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Branch a File
Visual SourceSafe branching for shared files is introduced in. This topic provides some specific branching procedures. See also .
When you branch a file and then delete the branched versions, the database does not recover space until all copies of the branched file in the database are destroyed.
Let's look at an example of branching. Suppose you are working on two programs for two clients. The two programs are virtually identical, but you want to tailor program behavior in one or two files. First, you share a project $/WORD to a new project $/CLIENT2. If $/WORD has subprojects, you recursively share them as well. You now have two projects that are identical in every way. Next, you select the few files you want to tailor in $/CLIENT2 and branch them. Now, when you modify these specific files in $/CLIENT2, your changes do not propagate to $/WORD. All the other files, however, are still shared between the two projects. If you modify any of the shared files, the changes will be propagated to $/WORD.
Here's another branching example. Suppose that after your project reaches version 3.1, development proceeds in two different directions. One team is working toward the next major release, the 4.0 version. The other team is working on a maintenance release, version 3.2.
You create a new project named $/PATCH to represent the 3.2 version. You branch all the files into it, using branching because you don't want the projects to track each other, since versions 3.2 and 4.0 are diverging, and changes made in one version are not automatically reflected in the other.
Later, you might want to merge the version 3.2 changes, for example, bug fixes or minor feature enhancements, into version 4.0. You can do this using the Merge Branches command. See.
To perform a basic branch operation:
Select the file(s) to branch in Visual SourceSafe Explorer.
On the Versions menu, click Branch.
On the Branch dialog box, type a comment in the Comment box to describe the Branch operation.