Configuration and use of CVS version control software

Source: Internet
Author: User

Configuration and use of CVS version control software

Author of released after zdm Modification

Configuration and use of CVS version control software

(1) software installation:
1. software acquisition: CVS is a typical server/client software, including cvs for UNIX, cvs for Linux, and cvs for Windows, the downloaded software package already contains the server and client, but we generally use Windows OS in our work, so we can download another client software wincvs for CVS in windows. You can obtain the latest version of CVS from the following websites.
2. Software Version: currently, the most up-to-date cvsin unixis cvs-1.11.5.tar.gz.
In Windows, the client software wincvs of CVS is wincvs1.3.
3. software installation:
Put your downloaded cvs-1.11.5.tar.gz to a temporary directory on the unix machine and enter this directory,
# Gunzip cvs-1.11.5.tar.gz
Run the following command to access the cvs-1.11.5.tar file:
# Tar xvf cvs-1.11.5.tar
To get a cvs-1.11.5 directory, enter this directory and execute the following command:
# Make
# Make install
If no error message is displayed during the installation process, your installation is successful. If any error is reported, check your system settings according to the error message.
The setup.exe file in the installation execution source file of the clientsoftware wincvs1.3in windows. You can specify the installation directory.
(2) configuration of the CVS software server:
1. After installing the software, we can start to configure the server. Generally, CVS uses the pserver authentication method as a service to run on UNIX,
Therefore, first make sure that the/etc/services file in the system has the CVS service entry. (if not, add the following two lines to the file:
Cvspserver 2401/tcp # CVS client/server operations
Cvspserver 2401/udp # CVS client/server operations
2. The CVS service is started through xinetd. We need to modify the/etc/xinetd. conf file and add a statement.
Cvspserver stream tcp Nowait root/usr/bin/CVS CVs -- allow-root =/home/cvsroot pserver
Since New Linux releases (such as redhat7.x) use the new xinetd instead of inetd, you need to enter/etc/xinetd to start the CVS service using xinetd. d/directory, and then edit a text file (the name is random). cvspserver is used as the file name. The content of this file is as follows:
Service cvspserver
Socket_type = stream
Wait = No
User = root
ENV = home =
Server =/usr/bin/CVS
Server_args = -- allow-root =/cvsroot pserver
Note that the name after the above service must be the same as the name of your CVs service in the/etc/service file. In the server_args line, we specify the pserver authentication method for CVs, this line may be misunderstood by the Env = home = line. The purpose of adding this line is to solve the Read/root/generated when performing some CVS operations /. cvsignore file error. The above env line indicates that the environment variable home is left blank when the CVS service is running, although the user executing CVS is root, however, because the environment variable home is not available, CVs will not read/root /. cvsignore file.

We recommend that you use the latter to start cvspserver. do not modify the/etc/xinetd. conf file to avoid conflicts.

3. to make CVS run properly, you also need to set users who need to use cvs. First, create a user group CVs, add a user cvsroot, modify the group attribute of user cvsroot, and make it a member of the CVS group.
Groupadd CVS
Useradd-g cvs cvsroot
4. Create a directory with any name or path. This directory is the directory that stores the user's source code, that is, the user's data warehouse (repository), which is the core part of CVS. Therefore, it is better to create a partition with enough space. Here, I created a cvsroot directory under the root directory.
# Mkdir cvsroot
5. create an environment variable cvsroot, which specifies the location of the Data Warehouse. If the shell you are using is CSH, you should edit it in your root directory. add the following statement to the cshrc file:
Setenv cvsroot/cvsroot
Note that the path must be the same as the directory path of your data warehouse.
6. initialize the directory of your data warehouse
CVS-D/home/cvsroot init
7. After the/cvsroot directory is initialized, A cvsroot directory is automatically generated under the/cvsroot directory. The files in this directory are the CVS configuration files. The main files are described as follows:
Checkoutlist supports other management files in the cvsroot directory and allows you to set information for various CVS commands.
When executing the CVS commit command, commitinfo specifies the command to be executed when the happy file is submitted.
Cvswrappers defines a packaging program that is executed when the file is registered or retrieved
Editinfo allows you to run the script after the log information is recorded before the commit command is started.
History tracks all commands that affect the Repository
Loginfo is similar to coimmitinfo, but is executed after the file is submitted.
Modules allows you to define a symbol for a group of files. Otherwise, you must specify the CVS repository path name ($ cvsroot) for each file to be referenced)
Nitify controls notifications from "watch". "Watch" is set by "CVS watch Add" and "CVS edit ".
Rcsinfo specifies a template for commit log calls.
Taginfo defines the program that can be executed after any tag operation.
Readers sets the list of users with read permission (this file is not available by default and must be manually added)
Writers sets a list of users with read and write permissions (this file is not available by default and must be manually added)

So far, the configuration of the CVS server has been completed. You can use your CVS server. You can test your CVS server. Enter the following command in the command line to log on to the CVS server. If no information is displayed, you have logged on to the CVS server.
CVS-D: pserver: cvsroot@ Login
(3) configuration of the CVS client software wincvs:
1. software Description: although the CVS software you install on UNIX includes the server and client, you need to remember the cumbersome commands during use, currently, wincvs is a CVS client running in windows,
2. install the software: Install the setup.exe file in the wincvsinstaller to the specified directory.
3. software startup: Start-Program-GNU-WinCVS1.3-WinCVS
4. Software Configuration: Select preferences under the Admin menu ..., Select the general page in the pop-up window. The specific settings are as follows:
Authentication: pserver (the authentication method is pserver, which is the default authentication method)
Path:/home/cvsroot (path of the data warehouse on the server)
Host address: (Server IP address)
User name: bjcvs (user name used to log on to the server)
Cvsroot: This item is automatically generated after the preceding project is set.

5. On the "globals" Page, deselect the check boxes before the following two items.
Checkout read-only (if you select this option, all items in the checkout are read-only)
Prune (remove) empty directory (the directory cannot be blank)
6. On the "wincvs" page ~ /. CVs * "is followed by a directory on your local machine,
The check out and check in operations you will perform later are all in this directory. "Default viewer used to" sets the default editor.
7. You do not need to set the "command dialogs" page.
(4) After selecting "admin"-"login", a window will pop up asking you to enter the password so that you can log on to the CVS server,
If you see the following information, your login is successful:
CVS-Z9 Login
Logging in to: pserver: bjcvs@ 2401/home/cvsroot
* ***** CVS exited normally with code 0 *****
All operations performed on CVS after "CVS exited normally with code 0" is not in the 0 state are all error operations.
(5) Use of wincvs:
1. Upload (checkin ):

Upload a directory:
In the middle of the form, there is an upload e page on the left. Click it and select the folder you want to upload. Click creat-> import module from selection in the menu bar and an Import Filter Form will pop out. If there is an error in your file, the Import Filter form will contain the error or warn flag. If so, you 'd better take a look at the problem first.
The next hop-out form is import setting. Enter a name in select the module name and path on the remote server. After your file is uploaded to the server, the CVS server creates a code library with this name to store the files just uploaded. Remember that the drop-down box does not have any magical functions. It can only remember what you entered last time.

Upload an object:
After adding a new file to the local working directory, submit it to the server. Select a file, click "add selected" in the toolbar, add a file, and select the submit command "Commit selection" from the context menu.

2. Download (checkout ):

Download a directory:
After the previous operation, you have the source code on the server, and all developers can start to work. Of course, developers need to download a copy to a local device before modifying it. Create a local working directory and create a new directory on your hard disk. For example, create a directory named "work" to indicate that this is a working directory. Select creat-> checkout module. The format displayed is checkout setting. In Module name and path on the server, enter the format in the previous step (upload file, the name of the module uploaded to the server. Enter your

Download an object:
If you accidentally delete a file in your local working directory, you can select a modules page on the left side of the form and select your working modules, right-click the file you accidentally deleted in the window on the right, and select update selection to synchronize and merge the files on the CVS server and local files without selecting any options, select "OK ".
3. Lock:
Generally, in a project team, the Project Manager regularly publishes the latest basic version, requiring team members to further develop the basic version in their actual work, some members always finish their work in advance. after submitting the changes, the latest version will be later than the basic version released by the Project Manager. Sometimes, some project members intentionally or unintentionally modify the base version and specify to submit it to the base version. If they are allowed to submit the modification, everyone may work on an incorrect base version, the consequences are unimaginable.
To lock a file, follow these steps:
In the menu bar admin-> comandline, enter this command:
Full name of the CVS admin-l version File
Note that there is no space between-L and version number.
If the lock is successful, the following message is displayed:
RCS file:/CVS/hrsystem/test/new.txt, V locked
* ***** CVS exited normally with code 0 *****

I can only say so much about the client-side wincvs of CVS. There is a lot of information about wincvs on the Internet. You can check it out,

(6) Description of the company's internal CVS account:
The company's internal CVS server has now been set up on the portal machine (, and a CVS user has been added to everyone. The user name is:
The full name of your surname + the first letter of the name,
For example, the CVS account of Zhang Daoming is zhangdm.
The password is the same as the user name and is also zhangdm
Currently, we are testing and learning the use of CVS. When you are familiar with CVS, Microsoft Visual sourcesafe is transferred to CVS.
(7) install Python 2.2.1.exe first (a new script is available now)


Related Article

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.