Configuration and Use of CVS Server and WinCVS (ZT)

xiaoxiao2021-03-06  115

The first part of the configuration CVS server (to version 1.10) Author: Wu Yan Xi Email: Yanxi-Wu@21cn.com 1, brief and install CVS CVS server: CVS is the more popular version with an excellent management and control tool, it deep Strive to most developers and system management, but also a powerful tool for managing other daily documents (such as Word Work Documents). 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, the installation of the CVS server can be downloaded from many places on the Internet, or you can download it from the official website of CVS. Download the appropriate version according to the system you use, then install it. Because most people are managed using the CVS server under Linux, and Redhat Linux is one of the most popular Linux distributions, so this article is mainly based on Redhat Linux. First download the RPM package of the CVS server, of course, you can also download other methods such as source packages, which is one of Linux's advantages. Then use the following command to install: rpm -ivh cvs-1.10.8-3.i386.rpm 3, configure / etc / services file: The first thing after installation is to configure the configuration file of the CVS server so that it can Normal work. First, add CVSPServer in the Services file, which makes it a service of Linux, is the entrance of the CVS server routine, configured as follows: CVSPServer 2401 / TCP # CVS Client / Server Operations CVSPSERVER 2401 / UDP # CVS Client / Server Operations 4, Configure xinetd, start the CVS server with xinetd: Go to the /etc/xinetd.d/ directory, then edit a text file, the name must be the same as the entry name CVSPServer in / etc / services, so here CVSPServer is used as the file name, The contents of the file are 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 for PServer, Note: -f} Note: A. The name behind Service must be the same as you in the / etc / service file; b, env = home = The purpose of this line is to solve The error generated when performing some CVS operations, the end of the ENV line means to set the environment variable home when running the CVS service, so that although the user who executes CVS is root, but due to There is no home this environment variable, so CVS will not read the /Root/.cvsignore file. 5. Configuring CVS users with CVSRoot's home and genus: First create a user group CVS, you can use GroupAdd or addgroup, you can also add this group directly to the / etc / group file, then add a user cvsroot, then modify / modify / The ETC / Passwd file enables the default group of the CVSRoot user, not the cvsroot group (that is, modifications).

Create a cvsroot directory in the / home directory (you can also be built in other directory you like), then modify the host and attributes of / home / cvsroot: #Chown cvsroot.cvs / home / cvsroot #chmod 771 / home / cvsroot 6 , VS is initialized: 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 adopted are as follows: #CVS -D / home / cvsRoot init This directory / home / cvsroot is 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 (Sign in under Linux or other UNIX system): a, if it is remote login, use the following syntax: #cvs -d: pserver: cvsroot @ host: / home / cvsroot login cvs password: / / Enter the password of the user cvsroot; if no other prompts appear, it means that the login is successful, otherwise, according to the prompt, the corresponding modification is performed. The syntax of the login command will be described: where: PServer means that the user login authentication is used in the PServer mode, and the general CVS server uses this approach. Of course, other ways, specific references;: cvsroot The username of the login, as long as it is a member of the CVS group, such as: Cather; @Host means that the server to log in, can be a DNS name, or an IP address, such as: 10.104.1.204;: / home / cvsroot Represents CVS Directory on the server or other directory (by directory decision by using the initial initialization you specify in Section 6); Tip: You can also put export cvsroot =: pserver: jchuang@192.168.0.8: / home / CVSRoot This sentence is written directly in the user's initialization file (such as: .bash_profile) so that users can log in to the CVS server only when the user logs in each time you log in. b, if it is locally logged in, you can write export cvsroot = / home / cvsroot in the user's initialization file such as .bash_profile; then directly 8, add a new project module to CVS, us, there is one or more A project, so we can generate a new CVS project with the following steps. 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 an existing project, such as the cvstest: $ cd cvstest running command to import the project file into the CVS warehouse: $ cvs import -m "this is a cvstest project" cvstest v_0_0_1 Start Description: Import is one of the commands of CVS Indicates input project files 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 the warehouse named after this name) v_0_0_1 is the total mark of this branch. Nothing to use (or not common) START is the key to the input level of the IMPORT logo file, no use. This creates a CVS module called cvstest under the directory / home / cvsroot specified by the user, then, we can delete this test item file, test how to get files from the warehouse this will be in the future End article will be described. (Note: This section mainly refers from HTTP: //LINUXAID.COM.CN He Weiping's "CVS Server Quick Guide") 9, from the CVS local server, the corresponding module: A. If it is on the computer where the CVS server is located, Use the following command directly: #CVS Checkout STW will put the STW project module Checkout to the current directory. B. If you are running Linux or other UNIX system, you can use the upper command to check the corresponding project module 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 Method 1 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.net/project/showfiles.php?group_id=10072 address, or downloaded to the latest on http://sourceforge.net/project Or other versions of WinCVS.

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 the setting of WinCVS: A, general option, select admin-> preferences ..., the following interface appears: First, Authentication: The authentication method used to configure the CVS server, you can select another authentication method from the drop-down box, but general As long as you choose the default PServer mode, you should note that you must consistent with the authentication method specified in the CVS server configuration; second, PATH: The main directory path used to configure the CVS on the server, that is, the server is used for CVS Initialized directory, such as: / home / cvsroot; third, host address: The address used to configure the server where the CVS server is located, or the DNS name, such as: 10.104.1.204; fourth, user name: Used to configure the username to log in to the CVS server, such as: cvsyxwu, the user's login must be added by the administrator to the CVS user group; fifth, cvsroot: This general does not require users to modify, users When a few options on the input, the system will automatically generate this corresponding content according to the user's input. b, the setting of the global option, select "Globals" on the previous interface: This configuration is mainly important to pay attention to these options: First, Checkout Read-Only Don't choose, otherwise, Checkout's source code will not allow The user is modified, and this option is selected by default; second, prune (transove) EMPTY DIRECTORIES should not be selected, otherwise it will automatically delete the empty directory; third, there is no special requirements for general configuration, put Dirty Files Support, Supply Control when Adding is selected; 4. Login Server: Select Admin-> Login, the following dialog box requests the user to enter the login password into the password, select the "OK" button if the CVS server is configured with WinCVS If you haven't erroneous, you will be prompted in the status bar of CVS: cvs -z9 -d: pserver: cvsyxwu@10.104.1.204: / home / cvsroot login logging in To: PServer: cvsyxwu@10.104.1.204: 2401 / Home / 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 CVS server, the CHECK OUT corresponding module: First, in the modules in Workspace Select the directory you want to store the Checkout module; On The Server is to store the directory of Checkout content, input by user; and Local Folder To Checkout To is the directory selected by the first in the first middle.

6. After the modification, the file is submitted to the CVS server a), only one user modifies the file to modify the file from the file, and the file after the modification will be red, as follows Figure EXAMPLE.H file: Select the red file eXample.h and right click to select the "Commit Selection" option, if no other users have modified it and have been submitted to the CVS server, everything will be submitted to the example.h file will be submitted. Go to the CVS server and restore the icon into the original color. b), the case of modifying the different parts of the same file in two or more users is that the user A and the user B CHECKOUT has the file EXAMPLE.H, the content is as follows: int Callby (int count) {Printf ("ExcelStor! / N");} void main (int Argv, char * arg) {// added by my cvs printf ("I am cather / n");} int mainexample () {Printf ("OK / N ");} Then user A is modified as follows, and submitted to the CVS server (generally submitted normal): int Callby (int count) {// add printf (" excelstor! / N ");} void main (int Argv, Char * argc) {// added by My CVS Printf ("I am Cather / N");} int mainexample () {// add printf ("ok / n");} Then the user B modified as follows: int Callby (int count) {// add printf ("excelstor! / n");} void main (int Argv, char * arg) {// modified printf ("I am cather / n");} int mainexample () { // Add Printf ("OK / N");} When the user b selects "Commit Selection": CVS Server: Up-to-Date Check Failed for `Example.h 'CVS [Server Aborted]: Correct Above Errors First! At this point, there is already a user to modify and submit the same file eXample.h and submit it to the CVS server. At this time, select "Update Selection" to synchronize and merge the EXAMPLE.H file on the CVS server. Do not use any options that appear, select "OK" directly, then display the following: cvs -z9 Update Example.h (in Directory C: / My CVS file: / home / cvsroot / STW /SRC /EXAMPLE.H ,V Retrieving Revision 1.5 Retrieving Revision 1.6 Merging Differences BetWeen 1.5 and 1.6 INTO EXAMPLE.H M EXAMPLE.H ***** CVS EXITED NORMALLY WITH CODE 0 ***** Indicates that user B and user A changes have been merged, and The icon of Example.h will also become red, the merged file is stored on the local machine in User B. You must also select Example.h to update to the CVS server and right click to select "Commit Selection" to bring users A and User B The result of modifying the merged result is submitted to the CVS server.

Note: m indicates that this file has been modified. c), two or more users modify the same part of the same file, as the user A and the user B download the file eXample.h, the content is as follows: void main (int Argv, char * argc) {Printf ("I am Cather / N");} Then user A modifies the file into the following and submits to the CVS server (generally submitting normal): void main (int Argv, char * arg) {printf "I am Cather / N"); Printf ("I am PAT / N");} Then the user B modifies the files as follows: void main (int Argv, char * arg) {printf ("I am Cather / N "); Printf (" i love you cather / n ");} If User B selects" Commit Selection "to prepare to submit the modification result to the CVS server, the following error tips are displayed: cvs -z9 commit -m "Update in 11:20" EXAMPLE.H (in Directory C: / My CVS Server: Up-to-Date Check Failed for `Example.h 'CVS [Server Aborted]: Correct Above Errors First ***** CVS EXITED NORMALLY WITH CODE 1 ***** Indicates that user B changes conflicts with other users, then select "Update Selection", will display the following prompt: CVS -Z9 Update Example. H (in Directory C: / My CVS file: /HOME/CVSROOT/stw/src/example.h ,v Retrieving Revision 1.9 Retrieving Revision 1.10 Merging Differences BetWeen 1.9 and 1.10 INTO EXAMPLE.H RCSMERGE: WARNING: Conflicts During Merge CVS Server: Conflicts Found in Example.h C Example.h ***** C VS EXITED NORMALLY WITH CODE 0 ***** EXAMPLE.H The front of the previous C conflict with other users, and the icon of the file will display a "C" as follows: Double-click Example.h will display Example. H content, as follows: void main (int Argv, char * arg) {printf ("I am yanxi / n"); Printf ("I am cather / n"); <<<<<<< EXAMPLE.H Printf ("I love you yanxi, TOO! / N"); // This part is your modification ======= Printf ("i love you"); // This part is other users Modify >>>>>> 1.10} At this point you should negotiate with the user A to determine how to modify it.

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

New Post(0)