Configuration and use of LinuxCVS server and WinCVS

Source: Internet
Author: User
Article Title: configuration and use of LinuxCVS server and WinCVS. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
   Part 1 configure the CVS server (in version 1.10)
   1. CVS brief and install the CVS server:
CVS is a popular and excellent version management and control tool. It is favored by most developers and systems, and also used to manage other daily documents (such as word work documents) is a powerful tool. This section briefly introduces the installation, configuration, and usage of the CVS server to help you use CVS for version management and control as soon as possible.
  
   2. Install the CVS server
The CVS server version can be downloaded from many places on the Internet or from the official website of CVS. Download the corresponding version based on your system and install it. Most people use the CVS server for Version Management in Linux, and Redhat Linux is one of the most popular Linux distributions. Therefore, this article will focus on Redhat Linux. First, download the rpm package of the CVS server. Of course, you can also download packages from other methods, such as the source package. This is one of the advantages of Linux. Run the following command to install the SDK:
Rpm-ivh cvs-1.10.8-3.i386.rpm
  
   3. Configure the/etc/services file:
The first thing after installation is to configure the configuration file of the CVS server so that it can work properly. First, add the cvspserver to the services file to make it the entry to a Linux service, that is, the cvs server routine. The configuration is as follows:
Cvspserver 2401/tcp # cvs client/server operations
Cvspserver 2401/udp # cvs client/server operations
  
   4. Configure xinetd and use xinetd to start the CVS server:
Enter/etc/xinetd. d/directory, and then edit a text file. The name must be the same as that in/etc/services. Therefore, cvspserver is used as the file name. The file content is as follows:
Service cvspserver
{
Disable = no
Socket_type = stream
Wait = no
User = root
Env = HOME =
Server =/usr/bin/cvs
Server_args =-f -- allow-root =/home/cvsroot pserver // specify the authentication method as pserver. Note:-f
}
Note: The names of a and service must be the same as those of the cvs service in the/etc/service file;
B. env = HOME = The purpose of 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.
  
   5. Configure the owner and group of the CVS user and cvsroot:
First, create a user group cvs, which can be named by groupadd or addgroup, or you can directly edit the/etc/group file to add this group, and then add a user cvsroot, then modify the/etc/passwd file so that the default group of the cvsroot user is the cvs group, rather than the cvsroot group (that is, the modification ). Create the cvsroot directory in the/home Directory (you can also create it in another directory you like), and then modify the owner and attributes of/home/cvsroot:
# Chown cvsroot. cvs/home/cvsroot
# Chmod 771/home/cvsroot
  
   6. initialize:
Another important thing after installing the CVS server is to initialize the root directory of the CVS server. The CVS projects created in the future will be created under this directory. The command used is as follows:
# Cvs-d/home/cvsroot init
In this way, the directory/home/cvsroot becomes the root directory of the CVS server, and the directories created later will be stored in this directory by default.
  
   7. log on to the cvs server (in Linux or other Unix systems ):
A. Use the following syntax for remote Logon:
# Cvs-d: pserver: cvsroot @ host:/home/cvsroot login
CVS password: // enter your cvsroot password;
If no other prompt is displayed, the logon is successful. Otherwise, modify the prompt accordingly. The following describes the syntax of the logon command:
Pserver indicates that the pserver method is used for user logon authentication. Generally, CVS servers use this method.
Of course, you can also use other methods. For details, refer to the relevant materials;
: Cvsroot indicates the user name to log on to. It can be used as long as it is a member of the cvs group, for example, cather;
@ Host indicates the server to log on to. It can be a DNS name or an IP address, for example, 10.104.1.204;
:/Home/cvsroot indicates the directory of CVS on the server, or it can be another directory (by your
Specifies the directory used for init initialization );
Tip: You can also put the export CVSROOT =: pserver: jchuang@192.168.0.8:/home/cvsroot sentence straight
It is written in the user's initialization file (for example,. bash_profile), so that each time you log on, you only need to enter:
# Cvs login
Enter a password to log on to the cvs server.
B. For local logon, you can directly write the export CVSROOT =/home/cvsroot statement in the user's initial
The initial file is shown in. bash_profile.
  
   8. Add a new project module to CVS
Generally, we already have one or more projects, so that we can use the following steps to generate a new CVS project. Place a project file in CVs for version control, which is called import in CVS terminology ). We can see from the name that some preparations need to be made before the import.
The basic requirement for input operations is to have a "clean" directory structure. "Clean" means that all files that do not require version control are removed (such as compiled files and backup files ). This is important if the project has started for a while. Some files in the directory may not be placed under version control, but you want to put them here. In this case, you need to remove them before entering them, and then move it back.
Note that CVS deems that the empty directory does not exist. To add a directory that does not contain files but does not contain subdirectories, you need to create a dummy file under it. We recommend that you create a file named README.txt with a brief description of the directory.
Enter the directory of an existing project, such as cvstest:
$ Cd cvstest
Run the following command to import the project file to the cvs Repository:
$ Cvs import-m "this is a cvstest project" cvstest v_0_0_1 start
Description: import is one of the cvs commands, indicating to input the project file to the cvs warehouse.
-The string following the m parameter is the description text to describe the project. If the-m parameter is not added, cvs will automatically run an Editor (usually vi, however, you can change the environment variable EDITOR to the EDITOR you like to use. You can enter information. cvstest is the project name (actually the repository name, it will be stored in the warehouse named after this name on the CVS server)
V_0_0_1 is the total mark of this branch. Useless (or not commonly used)
Start indicates the input level mark of each import Identity file, which is useless.
In this way, a CVS module named cvstest is created under the/home/cvsroot directory specified by the user. Then, we can delete the file of this test project, this document describes how to obtain files from the repository in a later client article.
(Note: This section mainly references "CVS server Quick Guide" from http://linuxaid.com.cn he Weiping ")
  
   9. Check the corresponding modules on the local cvs server:
A. Run the following command on the computer where the CVS server is located:
# Cvs checkout stw
In this way, the stw project module is checkout to the current directory.
B. If you are remotely running Linux or other Unix systems, you can use the preceding command after logging on to MySQL 7th.
So that the corresponding project module is checkout to the current directory.
In addition, if you run the checkout command on windows, you can use WinCVS. You also need to perform other configurations on WinCVS. The configuration method of WinCVS is described in the next section.
  
   Part 2 configuration and usage of WinCVS
   1. WinCVS introduction:
WinCVS is a client software of CVS. It runs on Windows and is used to log on to the CVS server on Windows and perform operations and management related to CVS. Many enterprises currently use Linux/Unix as servers and Windows as clients. Therefore, the combination of WinCVS and the CVS server will constitute one of the most powerful version control and management systems.
  
   2. Download and install WinCVS;
The latest WinCVS can be from http://sourceforge.net/project/showfiles.php? Group_id = 10072 address download to, you can also download to the latest or another version of WinCVS on the http://sourceforge.net/project.
Download the corresponding version and install it according to the Wizard. If you want to use CVS, it should be okay to install this WinCVS!
  
   3. Configure WinCVS:
A. For general options, select Admin-> Preferences ..., The following page is displayed:
  
1. Authentication: used to configure the Authentication method of the cvs server. You can select other Authentication methods from the drop-down list. However, you only need to select the default pserver mode, note that the authentication method must be the same as that specified in the cvs server configuration;
2. Path: used to configure the main directory Path of cvs on the server, that is, the directory for cvs Initialization on the server, such as/home/cvsroot;
3. Host Address: used to configure the Address of the server where the cvs server is located. It can be an IP Address or DNS name, for example, 10.104.1.204;
4. User name: used to configure the username to use WinCVS to log on to the CVS server, for example, cvsyxwu. The administrator must add the User to the cvs User group for logon;
V. CVSROOT: This option generally does not require modification. When you enter the preceding options, the system automatically generates the corresponding content of this option based on your input.
B. Set Global Options. On the previous interface, select "Globals ":
  
This configuration item mainly focuses on the following options:
First, do not select Checkout read-only. Otherwise, the source code of checkout is not allowed.
Modify, and this option is selected by default;
Second, do not select Prune (remove) empty directories. Otherwise, the empty directory is automatically deleted;
Third, if there are no special requirements for general configuration, set Dirty files support, Supply control when adding
Select from the TCP/IP compression option;
  
   4. log on to the server:
Select Admin> login. The following dialog box is displayed.
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: info-contact@alibabacloud.com 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.