Configuration and use of CVS in Linux

xiaoxiao2021-03-06  61

Configuration and use of CVS in Linux

The first part of the CVS server configuration

1, CVS brief description:

CVS is the abbreviation of Concurrent Versions System. It is currently a popular and excellent version management and control tool. It is well received by most developers and system management, and is also used to manage other daily documents (such as Word work documents. A powerful tool. This section will make a simple, concatenation and use method of the CVS server, to help you use CVS as soon as possible to make some versions of management and control work.

2, installation of the CVS server

By default, CVS is already installed in Redhat Linux, which can be run by the Linux command line:

RPM -Q CVS

If the version of the CVS appears, it has proven to be installed successfully.

The CVS server installation package can be downloaded from many places on the Internet or downloaded from the official website of CVS. Download the appropriate version according to the system you use, then install it. Because our project is managed using the CVS server under Redhat Linux, this article will be mainly based primarily based on RedHat Linux. First download the RPM package of the CVS server, of course, you can also download other ways such as source packages, and then use the following command to install:

RPM-IVH CVS-1.11.1-7.rpm

3, CVS server configuration

The first thing after installation is to configure the configuration file of the CVS server to work properly. First, add CVSPServer in the / etc / service file, which makes it a service of Linux, is the entrance to the CVS server routine, configured as follows:

CVSPSERVER 2401 / TCP # cvs client / server Operations

CVSPServer 2401 / UDP # cvs client / server operations

If there is already the two lines of text in the file, you don't have to add it.

4, configure Xinetd, start the CVS verification server with Xinetd:

Go to the /etc/xinetd.d/ directory, then edit a text file, the name must be consistent with the entry name CVSPServer in / etc / services, so use CVSPSERVER as the file name, the contents of the file are as follows:

Service CVSPServer

{

Disable = no

Flags = Reuse

Socket_type = stream

Wait = NO

User = root

Server = / usr / bin / cvs

Server_Args = -f --allow-root = / usr / cvsroot PServer

LOG_ON_FAILURE = UserID

}

After editing the file, test whether the CVSPSERVER service is configured successfully.

carried out

/etc/init.d/xinetd Restart

Restart the service, after starting success, execute the following statement, verify that the service is normal:

Telnet Localhost 2401

If the following words appear:

Trying 127.0.0.1 ...

Connected to Localhost.

Escape Character is '^]'.

Enter Hi, will continue to output the following words

CVS [PServer Aborted]: Bad Auth Protocol Start: Hiconnection CLOSED by Foreign Host.

The above phenomenon indicates that the CVS user verification server has been configured successfully.

If there is a word as follows, the configuration is unsuccessful, please retrieve the above configuration:

Trying 127.0.0.1 ...

Telnet: Connect to Address 127.0.0.1: Connection Refused

5, configure CVS users:

First create a user group CVS, you can use GroupAdd or addGroup, you can also edit the / etc / group file directly to add this group, then add a user cvsuser:

GroupAdd CVS

UserAdd Cvsuser -g CVS

Passwd cvsuser

Set the new password.

Establish a cvsroot directory in the / usr directory (you can also be built in other directory, but should be consistent with the options in the CVSPServer file), then modify the primary and attributes of / usr / cvsroot:

CD / USR

Mkdir CvsRoot

Chown -R Cvsuser: CVS CvsRoot

CHMOD -R 771 CVSROOT

6. Initialize CVS servers

Another important thing after installing the CVS server is to initialize the root directory of the CVS server, and the CVS project created later will be built in this directory, the commands employed are as follows:

CVS -D / USR / CVSROOT INIT

If there is no prompt, it indicates that the initialization is successful. After initialization is successful, create a cvsroot directory in the / usr / cvsroot directory, and there is a file in the directory:

-r - r - r - 1 Root root 493 APR 5

20:19

CheckoutList

-r - r - r - 1 root root 693 APR 5

20:19

CheckoutList, V

-r - r - r - 1 root root 760 APR 5

20:19

Commitinfo

-r - r - r - 1 root root 960 APR 5

20:19

Commitinfo, V

-r - r - r - 1 root root 527 APR 5

20:19

Config

-r - r - r - 1 root root 727 APR 5

20:19

CONFIG, V

-r - r - r - 1 Root root 753 APR 5

20:19

Cvswrappers

-r - r - r - 1 Root root 953 APR 5

20:19

Cvswrappers, V

-r - r - r - 1 Root root 1025 APR 5

20:19

Editinfo

-r - r - r - 1 root root 1225 APR 5

20:19

Editinfo, V

Drwxrwxr-x 2 root root 4096 APR 5

20:19

EMPTYDIR

-rw-rw-rw- 1 root root 0 APR 5

20:19

History

-r - r - r - 1 Root root 1141 APR 5

20: 19Loginfo

-r - r - r - 1 Root root 1341 APR 5

20:19

Loginfo, V

-r - r - r - 1 root root 1151 APR 5

20:19

Modules

-r - r - r - 1 root root 1351 APR 5

20:19

Modules, V

-r - r - r - 1 root root 564 APR 5

20:19

NOTIFY

-r - r - r - 1 root root 764 APR 5

20:19

Notify, V

-r - r - r - 1 root root 649 APR 5

20:19

RCSInfo

-r - r - r - 1 root root 849 APR 5

20:19

RCSINFO, V

-r - r - r - 1 Root root 879 APR 5

20:19

Taginfo

-r - r - r - 1 Root root 1079 APR 5

20:19

Taginfo, V

-rw-rw-rw- 1 root root 0 APR 5

20:19

Val-tags

-r - r - r - 1 Root root 1026 APR 5

20:19

VerifyMSG

-r - r - r - 1 Root root 1226 APR 5

20:19

VerifyMSG, V

Such a directory / usr / cvsroot becomes the root directory of the CVS server, and the directory created later will save the default in this directory.

7. Log in to the CVS server (where you log in under Linux or other UNIX systems):

Enter the following command:

CVS -D: PServer: cvsuser @ localhost: / usr / cvsroot login

Tip Enter your password, enter the password set above, if there is no prompt, you will prove the successful login.

After the login is successful, generate a .cvspass file in the current user's $ home directory, you can use VI to see files.

Since "." Is hidden in Linux, you can use the following command to check:

LS -A

This file records the user's login information. The execution logout command can delete login information in the file

CVS -D: PSERVER: CVSUSER @ localhost: / usr / cvsroot logout

The syntax of the login command will be described below:

Among them,: PServer means that the user login authentication is used in the PServer mode, and the general CVS server uses this approach, and of course, other methods can be used, and the corresponding information can be used;

: cvsuser indicates that the user name to log in, as long as it is a member of the CVS group, such as: cvsuser;

@Host means that the server to log in can be a DNS name or an IP address, such as: 192.168.0.1;

: / usr / cvsroot represents the directory of the CVS on the server, or other directory (by the directory determined by the directory initialization);

prompt:

A, you can also write export cvsroot =: pserver: cvsuser@192.168.0.1: / usr / cvsroot this sentence directly in the user's initialization file (such as .bash_profile) so that users only need to enter: CVS each time you log in login

Then enter the corresponding password to log in to the CVS server. B. If it is locally logged in, you can write export cvsroot = / usr / cvsroot in the user's initialization file such as: / etc / profile; then perform the following command to make the environment variables:

Source / ETC / PROFILE

8, add a new project module to CVS

Generally we have one or more projects so we can use the following steps to generate a new CVS project. Place a project file in CVS for version control, referred to as import (Import) in CVS terms. It can be seen from the name that you need to work for this before importing.

The basic requirement of the input operation is a "clean" directory structure. "Clean" means that there is no version of the file that is removed (such as compiled and generated files, backup files, etc.). If the project has started for a while, this is very important. In the directory, some are not intended to place them under version control, but I want to put them here. In this case, you have to remove them before entering, and then move back.

Note that CVS thinks that the empty directory does not exist. If you want to add a directory that neither files that don't contain subdirectories, you need to create a dummy file under. It is recommended that you create a file called readme.txt whose content is a brief description of the directory.

Enter the directory of existing projects, such as CVSTest:

CD / home / cvsuser / cvstest

Run the command to import the project file into the CVS warehouse:

CVS import -m "this is a cvstest project" cvstest tengtu start

Note: Import is one of the commands of CVS, indicating an input project file to the CVS warehouse.

The strings behind the -m parameter are description text, describe the project, if the -m parameter is not added, then CVS will automatically run an editor (typically vi, but can change to you like to use the environment variable editor. Editor) Let you enter information, cvstest is the project name (actually a warehouse name, stored in a warehouse named after this name)

TENGTU is this manufacturer tag.

START is a tag of the input hierarchy of the IMPORT identification file.

9, from the CVS local server, CHECKOUT corresponding module:

A. If it is on the computer where the CVS server is located, you can directly use the following command:

CVS Checkout Cvstest

This will use the CVSTEST project module Checkout to the current directory.

B. If you are running Linux or other UNIX system, you can also use the previous command to Checkout to the current directory after logging in.

In addition, if you checkout in the Windows side, WinCVS can be used, then some of the other configurations of WinCVS, the next part will specifically describe its configuration method.

Part II WinCVS configuration and usage

1. Introduction to WinCVS:

WinCVS is a client software for CVS, which is running on Windows to log in to the CVS server on Windows, and then make some CVS related operations and management. Since there are many companies currently use Linux / UNIX to do server, use Windows to do a client, so WinCVS and CVS servers will use the most powerful version control and management system. 2, WinCVS download and installation

The latest WinCVS can be downloaded from http://sourceforge.net/project/showfiles.php?group_id=10072 address, or downloaded to the latest or other versions of WinCVS on http://sourceforge.net/project. After downloading to the corresponding version, install it according to the wizard, you have to use CVS users, install this WinCVS should have no problem!

3, configure WinCVS:

The general option setting, select admin-> preferences ..., the following interface appears:

Figure one

The setting of the global option, select "Global" on the previous interface:

Checkout Read-Only Don't choose, otherwise, the source code from Checkout will not allow the user to do.

4, login server:

Select Admin-> Login, the following dialog will appear as required by the user to enter the login password.

Figure II

After entering the password, select the "OK" button. If the CVS server is not wrong with the WinCVS configuration, it will be prompted in the status bar of the CVS:

CVS -Z9 -D: PServer: cvsuser@192.168.0.1: / usr / cvsroot login

Logging in to: PServer: cvsuser@192.168.0.1: 2401 / usr / cvsroot

***** CVS EXITED NORMALLY with CODE 0 *****

Code 0 indicates the correct login; if an error, it will be Code 1, then the corresponding modification is performed according to the error prompt.

5, from the CHECK OUT corresponding to the CVS server:

Select Create-> Checkout Modeles, the following dialog box appears:

Figure three

6. Submit the file to the CVS server after modification

A file can be displayed in WinCVS after modifying the storage, click on the right mouse button to select CMIT Selection ... You can submit the files after the modification to the CVS server.

7, add new files to the CVS server

After adding a file locally, you are submitted to the server. First select the file, then click "Add button", after adding the file, then select the submit command "Commit Selection" in the right-click menu.

Conclude

The above is a brief introduction to the CVS server and the WinCVS client.

转载请注明原文地址:https://www.9cbs.com/read-118418.html

New Post(0)