Detailed application of VSS source code management

Source: Internet
Author: User
Tags dedicated server create database

The source code version control mechanism is one of the essential management mechanisms in modern software development, which is usually realized with the help of version control software, source code Management (SCM) systems, or version controlling systems. The important role of version control in software development is as follows:

1 as a code warehouse effective management software development in various versions of the source code and documents, occupy small space and facilitate the various versions of the Code and document acquisition.
2 effective coordination of access to the source code in the development team (different version control software adopts different coordination strategies).
Common version control software is ClearCase, CVS, PVCs, and Microsoft's visual SourceSafe (VSS). The following is a brief introduction to the most commonly used visual SourceSafe 6.0 for Windows platform development.

Operating Environment

The typical environment developed using VSS under the Windows platform is based on the C/S architecture, where each developer of the development team uses development tools (such as VC) to develop each module of the project under its own Windows platform, with a dedicated server that centrally controls the documentation and code in the development process. Server and developer clients have VSS's server and client programs installed separately.


Installation of the VSS6.0 server

The first step is to put the visual Studio6.0 CD1 into the CD-ROM, automatically enter the installer, and select the second "Server applications and Tools".
The second step, then in the "Server setups" in the "Server components" select "Visua l Source Safe Server", press the "Install" button, according to the prompts into the CD2;
Third step, according to Installation wizard prompts, continue the installation process, select the installation path, until you are prompted to reboot to make the newly installed program effective, restart the computer.

Installation of VSS6.0 Client

After the VSS6.0 server is installed, the client's software can be installed under the direction of the VSS Administrator. Because we are within a subnet of a Windows environment, each PC client can access the VSS server through its network neighborhood. After the VSS administrator indicates to the user the location of the VSS client software Installer "Netsetup.exe" (within the VSS Server installation directory), the user can locate the program in the Network Neighborhood directly from Explorer "explorer" and double-click to run it. After the Netsetup.exe is launched into the VSS client installation, enter the user name and workgroup name in the Prompt box, select the VSS installation path, click the Install icon, enter the actual installation steps, and the work will be completed automatically by the system.

Instructions for use

VSS uses the Lock-modify-unlock process rather than the copy-modify-merge process (such as CVS) to follow. That is, the developer first modifies the source code and documents from the VSS server Master backup file to checkout the source and document on the server at the same time (except in the case of Multi-checkout), and checkout the file on the server at the same time when the modification is complete. The server centrally controls all source programs and documents.

concepts involved in the use of VSS

1 Project (project) is a group of files (any type) that exist in VSS that can be added, deleted, edited, and shared between projects or between projects. A project has many similarities to the operating system's folders, but it better supports file merging, history, and versioning. All files exist in a VSS database project, and members of the development Group cannot work on server master backup files in VSS (except for checks and versions other than Peer-to-peer special cases) but VSS provides each member with a copy under its own working directory (Workfolder) for work. Although you can view a file without a working directory, you must create a working directory if you want to actually work under VSS management.
2) The working directory (Workfolder) is where the user actually modifies the project file, and when the user checkout the file, VSS will copy the file to the user's working directory, and when the user modifies the file and checkin it, VSS then copies it back to the VSS database from the user's working directory. When a user makes a checkout, VSS will automatically manage his working directory, such as creating the necessary subdirectories. and the working directory can be created or modified at any time.
3) version tracking. VSS provides versioning and historical services, and older versions of programs and documents can be restarted for bug tracking or other purposes. VSS uses a date/time stamp to record when a file was checkout, or when it was modified, and there are three main ways to track the version of the file and project:

Version number: This is the internal digital maintained by VSS and the user has no control over it. Each version of each file and project has a version number, which is always an integer and is incremented.

Labels: these are a string of characters that a user assigns to a version of an item or file, and can be a string of no more than 31 character in any format. Recommended use.

Date/time stamp: It gives information about when a file was last modified, or when a file was checkin. VSS also supports 12-hour and 24-hour time formats.

configuration and management of VSS6.0 servers

After the VSS6.0 server has been installed, you can configure and manage the VSS server for the development project, which needs to be done by the VSS administrator.
The first step is to create a VSS database for the entire project (when the VSS server is installed, the system has created a default database Common) to start visual SourceSafe6.0 Admin (start/programs/microsoft Visual Studio6.0/microsoft Visual sourcesafe/visual Sou rceSafe6.0 Admin), step out of the Dialogue window, click the Create Database in the Drop-down menu tools ... menu item, the dialog window will appear, select the path to the new database, for example, create the MyApp database, and then click the OK button, the system will complete the creation work.
The second step is to create a user for a newly created database (such as MyApp), first you need to open the database, click the Drop-down menu Users/open SourceSafe Database ..., and then select the databases MyApp and open. And then select menu item Add User ..., enter username and password. Then create another user in turn. There are two ways to set different access permissions for different users for different project folders: 1 Use the functionality provided by VSS. Select Tools/options ... dialog box porject The Security property page's Enable Project Security check box and select Tools/rights by Project ... or tools/rights Assignments for User ... 2) using the Windows operating system's CACLS command.
The third step is to create project projects in the newly created database. Start Microsoft Visual SourceSafe6.0 (start/programs/microsoft Visual Studio6.0/microsoft visual Sourcesafe/microsoft Visual SourceSafe6.0), the dialog window appears, click the dropdown menu file, open SourceSafe database ..., step out of the dialog box, select a database (for example, MyApp), double-click it, or press the Open button to open it A project is a set of related documents or a collection of files, and VSS allows you to store and organize your project in any hierarchy. In the VSS database, you can create one or more projects. Click the command in menu file to create Project ..., creating a project, such as MyProject; After you create the project MyProject, you need to add the file to MyProject, click the Add Files command in file, and you will jump out of the dialog box, Select the appropriate files or directories and click the Add button to add them to the MyProject.
At this point, the configuration of the VSS server is basically complete, the databases and projects are created, and the appropriate users are established for them, so that the user can log on to the VSS server directly on the client and perform development work under VSS control management.
Note: The directory structure of the server master backup file should be identified and approved by all developers prior to project development. In the actual use process, if the server master backup file directory structure is unreasonable or need to temporarily increase the deletion of some files, the VSS Administrator is responsible for centralized processing.

use of VSS6.0 clients

The following is a concrete example of the lab Data Warehouse project that describes the VSS client usage steps.

The first step is to log on to the VSS server. Start the Microsoft Visual SourceSafe6.0 Client (start/programs/microsoft visual Studio6.0/microsoft visual Sourcesafe/microsoft Visual SourceSafe6.0), the following login window appears;

Click Browse ... button, the following dialog box appears;

Then click Browse ... button, select the directory shown in the following figure (the shared directory on the Dbgroup server, if prompted to enter the Dbgroup Server account password, fill in the Vss/vss);

Click the Open button and click OK and open on the two dialog boxes that appear later;

Return to the Login dialog box;

Enter the user name and password specified by the administrator to log on to the VSS server.
Note: Different user and password settings have different access rights to different directories (project).

In the second step, if you are logging on to the VSS server for the first time, you need to set the working directory first, otherwise you cannot perform the checkout operation.
The working directory is set as shown in the following figure, select the folder of your own related module, right-click, select Set Working folder ... ;

In the pop-up dialog box, select your own set of working directory and click OK;

Note: After the working directory has been set up, the files on the server are checkout to the working directory, so the working directory on the local machine should be protected from deletion and movement.

The third step is to checkout the file to the local working directory. Select the related folder, right-click and select Check out ... ;

The system pops up Checkout dialog box below, click OK after all files and subfolders in the directory are checkout to the local working directory and the files on the server are locked red. Other users can no longer checkout this folder (the server is set to disallow Multicheckout).
Note: Be sure to select the Recursive check box to ensure that all subfolders are checkout.

The fourth step is to modify and debug the files in the local working directory.

The fifth step is to checkin the files in the working directory. If you do not checkin the modified file, the modification of the file in step fourth cannot be reflected in the master backup of the project file on the server, and is highly likely to result in the local file being overwritten by the old version file after the next checkout. Select the folder you want to checkin in the VSS client window right-click the check in ..., pop up the Checkin dialog box, and click OK the files in your local working directory checkin to the server and the files on the server are unlocked (darken).

Note: Be sure to select the Recursive check box to ensure that all subfolders are checkin.

Recommendation 1

In the actual use of the process, the developer or Administrator is responsible for the server's source programs and documents on a regular or irregular label, to facilitate the source program and document history version of the management. VSS makes it easy to get individual historical versions based on the label (there are other ways to get historical versions, this article recommends using the Label method).
Add a label. Select the directory to which you want to add a label (project) Right-click to select the label ... ;

Set the Label dialog box to fill in the label name and related comment, as shown in the following figure;

To get a historical version, select the appropriate directory (project) and select Show History ..., select the check box as shown in the following illustration, and click OK;

VSS pops up the following dialog box that lists all the administrator-made labels, selects the appropriate label, and then clicks the Get button to make the corresponding version of the label checkout to the local working directory. Use of other buttons see Help;

Recommendation 2

Developers should not arbitrarily change the directory (project) structure on the VSS server, do not arbitrarily add delete files to the directory (project), and do not randomly access other people's Directories (project) and files. If the directory (project) structure on the server does need to change, contact your administrator.

recommendation 3

Strictly follow the procedures used by VSS to prevent the loss of programs or documents caused by misoperation. If you need to modify a unified directory (project) or file at the same time, use serial processing instead of multicheckout to reduce the chance of error.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.