What Is Source Code Control?

   

With source control systems, you use a database to track, organize, and manage "projects." These projects are a unit of organization, like a folder, and can contain various kinds of files (items), including code and documentation. This version control enables you to more flexibly manage the contents of projects (for example, to include only items labeled as a "release" version of the application) and manage project history (to restore an older version, for example, for testing or rerelease). Some features are available only in the Microsoft development environment; some features are specific to Visual SourceSafe only. This section describes what you can do with each feature set and what you can do using them together.

With Visual SourceSafe and the Microsoft development environment, you can:

Controlling All the Projects and Solutions in One Central Database

A typical source code control configuration assumes that all the files are kept in one master source code control database on a server, linked to the developers' computers by a network link. The master database is where you store the original information, such as code and documentation, and the individual computers are where you edit and compile the files. With a central location of the files for your team, you can better control the access to the files and the organization of the project tree.

Using the Source Control Commands in the Project Explorer

The Microsoft development environment integrates the basic commands and functions of Visual SourceSafe directly into the Project Explorer for ease of use. The development environment also tracks the status of the projects and solutions to aid with renaming, adding, and deleting files to Visual SourceSafe.

You can maintain the files and code in the master source control database through these four basic commands, available in the Project Explorer (in the development environment):

Viewing the History of a Project

You can see the history of a source control project through the History command in the development environment. This tells you when the latest changes were made, and by whom, and what happened to the item each time it was checked in, from the time it was first created. For step-by-step instructions, see Viewing the History of a Source Control Item.

Sharing Files

You can share an item across more than one source control project (Visual SourceSafe only). When you update one copy of the shared file, all copies reflect the new changes. The shared item is stored only once in the Visual SourceSafe database, with pointers to the item in the other projects. For step-by-step instructions, see Sharing a Project.

This method makes it possible to share common components across several different projects. Keep in mind that source control systems can store any kind of item — including code, documentation, stored procedures, and HTML items.

Branching Shared Files

Branching is feature specific to Visual SourceSafe. You can branch a project in source control by sharing a project to an additional location in your source control project tree. When the project is shared, you can choose to branch the project, and the connection to the duplicate project is broken, so that changes are no longer updated from the other shared projects.

You can use the Change Location command in the development environment to point your local project to the new location of the project in source control. This feature is useful for creating a special version of a common file, for creating separate versions for language differences, or for customizing an application. You can also use this feature to branch files of a specific version of the finished application.

Merging Versions Together

You can put two versions of the same item together with the merge feature (available only in Visual SourceSafe). This feature displays the two versions of the items side by side in Visual SourceSafe, and you reconcile the changes you want to keep in the final version of the item.

Merging versions is useful if the multiple check out feature in Visual SourceSafe is enabled. This is also useful when updating changes to a branched item.