Install and use CVS in Linux

Source: Internet
Author: User

Installing and using CVS in Linux is the abbreviation of Concurrent Version System (parallel Version System) for Version management. if everyone has participated in many collaborative development projects, everyone is sure to have such sad experience: because many individuals and individuals correct the same document at the same time, the hard-working measures have been permanently deleted by others. otherwise, if you have released three versions of your software/measures, and you need to correct the objects of the second version at this time, you may be crying because you have only used the latest version. There are still some corrections you have made to the measures, but there are very few corrections. You just want to send a different document between two versions to colleagues in the distance, so that you can avoid mailbox shortage, the network speed is too slow. in order to understand such a problem, and such as natural patch files, historical version correction, a bunch of hackers (derogatory) in the original Unix system is very mature SCCS and RCS fundamental, opened up CVS. (SCCS: Source Code Control System, RCS: Revision Control System ). The root idea of CVS is like this: an inn is set up on a theme, and many different policies and source measures can be sent to the inn. These source measures are managed by the inn administrator. in this way, it seems that only one person is correcting a document. stop fighting. before applying the inn, each user should first download the project files in the inn to the mainland. Any corrections made by the user are first held in the Mainland, and then submitted with the command of cvs, which will be corrected by the cvs inn administrator. in this way, we can track file changes and fight for dominance. because CVS is a typical C/S structure software, it is also divided into two parts: the server side and the client side. However, most CVS software merges them into one. We will discuss the application of cvs from the perspective of the worker and client. Install the Cvs operator first, and ensure that the system is installed with cvs: [root @ mail xinetd. d] # rpm-qa | grep cvs cvs-1.11.1p1-3 if the command output is similar to the above output, then the analysis system has installed cvs, otherwise it is necessary to install the cvs rpm package from the installation disc. 1. Create a CVS owner: # useradd-d/cvsroot cvs # chmod 771/cv sroot 2. Create a CVS Inn (initialize cvs) # su cvs $ cvs-d/cvsroot init $ exit #4. Start the cvs operator in/etc/xinetd. d. Create The file cvspserver in The directory. The content is as follows: # default: on # description: The cvs server sessions; service cvspserver {socket_type = stream wait = no user = root server =/usr/bin/cvs server_args =-f -- allow-root =/cvsroot pserver log_on_failure + = USERID only_from = 192. 168.0.0/24} in this example, only_from is used to restrict access to construction. It can be corrected based on actual conditions. Correct the File Permission: # chmod 644 cvspserver and restart xinetd: #/etc/rc. d/init. d/xined restart and check whether the cvs operator is running: [root @ mail xinetd. d] # netstat-lnp | grep 2401 tcp 0 0 0.0.0.0: 2401 0.0.0.0: * LISTEN 7866/xinetd indicates that the cvs operator is running. 5. The cvs user created before the user is created to visit cvs is the cvs inn Management User. To allow the user to visit, a user is also required to visit the user: # useradd cvspub # usemod-G cvs cvspub here a user cvspub is added and added to the cvs group. 6. Manage the cvs operator and manage the cvs operator. the worker can be used. Now everyone cares most about how to manage it. For example, I want some people to have the permission to read and/or write CVS Inn, but what if I don't want to give it system permissions? It's not hard. After the cvs initialization ends, there is a CVSROOT directory in the main directory of the administrator user (here it is the cvs user), which contains three setting files: passwd, readers, writers. We can set the CVS worker by setting these three files. The role of these files is identified below: passwd: user list file of cvs users, the two technologies are like the shadow file: {cvs user name}: [encrypted password]: [equivalent system user name]. If you want a user to be a cvs user rather than a system user, then you need to set this file. After installation, this file may not exist. You need to manually create it as a cvs Administrator (su cvs). You must follow the above skills; the second field is the user's encrypted password, which is encrypted with crypt (3). You can write a method for encryption, or use two lazy actions: create a system user with the same name as the cvs user. The password is the cvs user password that is prepared for the user. After the user is created, copy the second field of the user from/etc/shadow, then delete the user. this action is suitable for users with a small number of users, and There is still a security risk of race condition, and root permissions are required. This is not really good, but it is a balance. The other action is to operate apche's htpasswd and order the creation of passwd users, to add a user, you only need to add the user to the passwd file by using the htpasswd passwd username. However, you need to add a ":" colon and the corresponding equivalent system username to the end of the corresponding row in the file; the best thing is to write a solution to pan? Sting? This passwd file is now available. The third field is the equivalent system user name. Actually, it is to grant an equivalent system user permission to a cvs user. You can see the example below to understand its functions. Readers: a user list file with the read permission of cvs, which is a one-dimensional list. Users in this file have only read permission on cvs. Writers: List Files of users with cvs write permissions. Similar to readers, writers is a one-dimensional list. Users in this file have the write permission on cvs. The above three files may not exist at the default installation time. We need to create them ourselves. Well, let's use an example to explain it now. suppose we have the following users who need to apply cvs: cvsuser1, cvsuser2, henry, betty, and anonymous. laser and gumpwu are system users, while henry, betty, we do not want to grant system user permissions to anonymous, and both betty and anonymous are read-only users, and anonymous does not even have a password. Edit the CVSROOT/passwd file in the cvs administrator's home directory and intervene in the following lines: laser: $ xxefajfka; faffa33: cvspub gumpwu: $ ajfaal; principal: cvspub henry: $ fajkdpaieje: cvspub betty: fjkal; ffjieinfn/: cvspub anonymous. Edit readers file, intervene in the following lines: anonymous betty edit writer file, intervene in the following lines: laser gumpwu henry so OK, you then use a few users to determine the login test, it will create all OK. I will not talk much about the principles and explanations in this section. It is really a little bit like the concepts of system management users. 7. Set up a new CVS project. We usually have one or more projects. In this way, we can use the following steps to create a new CVS project. Place a project file in CVs to hold the version Dub, which is called import in CVS terminology ). From the name, we can see that some preparations must be made before the import. The root request for input manipulation is to have a "clean" directory structure. "Clean" means that all files of the unsupported version have been removed (such as compiling native files and backing up files ). This is important if the project has already started. Some files in the table of contents that do not insist on putting them under the dual version, but want to put them here. In this case, you need to remove them before entering them, and then move back. Note that CVS considers that the empty directory does not exist. If you want to enhance the contents of a non-pregnant file but not a pregnant file, you must create a dumb file under it. We suggest you create a file named README.txt, whose content is a brief analysis of the contents. Go to the existing guidelines, such as cvstest: $ cd cvstest. Run the command to import the project file to the cvs Inn: $ cvs import-m "this is a cvstest project" cvstest v_0_0_1 start explanation: import is one of the commands of cvs, indicating to input the project file to the cvs Inn. -The string at the end of the m parameter is the characterization text, which is used to portray the project. If the-m parameter is not added, cvs will take the initiative to run an Editor (normally vi, however, you can change the environment variable EDITOR to an EDITOR that you like to use. You can enter information. cvstest is the project name (actually the inn name, the CVS operator is stored in the inn named by this name.) v_0_0_1 is the total symbol of this branch. not useful (or not commonly used) start is the input organization symbol of each import mark file, not useful. In this way, we have set up a CVS Inn. Then, we can delete this test item policy file and try to get the file from the inn. This will be explained in the client post. Install and apply CVS on Win2k 1. Prepare related software: Download worker cvs-1.10.8NT.exe.zip from www.cvsnt.org download client WinCvs11b16.zip from www.wincvs.org decompress cvs-1.10.8nt.exe.zip to d: cvs. Decompress and install wincvs. 2. Add path d: cvs to the path environment variable. Action: click "my", right-click, select properties, and click the environment variable button. 3. Set up the CVS storage directory. Open a dos window and type "cvs-d: local: d: cvsroot init". Then, you will create a root sub-object under d: cvs. 4. register CVS. In the dos window, type "ntservice-I d: cvsroot", and the screen displays "CVS NT Service Installed successfully". Open the operations on the dashboard, you will create another "cvs nt Service" to start cvs with "net start cvs. Use "net stop cvs" to close cvs. 5. Set the password to create a vacant passwd file and place it in the d: cvsrootcvsroot directory. Use the pwgen.exe native password. Write the user name and password to the passwd file, for example: test: OuIgxgsUZH48g 6. select Admin-> Perferences for the application wincvs and set CVSROOT to ": pserver: test @ server: d: cvsroot". The server is the name of the timer used as the worker. Test is the user name. 7. Select Admin-> login for login and enter the password for login. 8. the import module assumes that the code to be managed already exists in the c: source directory. Select the import module in the pop-up menu, select the directory c: source, and enter the module name "test ", wincvs imports the directory to the test module. 9. Select Create-> checkout module for the export module, and enter the module name and corresponding directory. 10. Select the document to be corrected and click the correction button (PEN icon ). Then, correct the file, and then click commit selection in the pop-up menu. The correction will be submitted. Download the cvs nt operator Installation Guide :; run cvsnt_1.11.1.2.exe and click "Next" twice. Skip the "Welcome" interface and start the Installation Point "Yes". Use the default Typical to install "Yes" and click "Finish ", restart to the desktop, right-click "my", click "attribute", click "higher", click "environment variable", and select the Path in "system variable, click "edit" and add "after the variable value; C: Program FilesCVS for NT" (do not intervene in the quotation marks), click "OK", and then "OK" to enter the dual panel, double-click "CVS for NT" and click "Install" to Install CVSNT. The "Install" button will become invalid. Click "Add" for "Uninstall" and enter "d: cvsroot ", click "OK" to ask if you want to create a directory, and then click "yes" to Start CVSNT and create a file named passwd under the d: cvsrootCVSROOT directory (no extension name) (How to create a file without an extension name: click "device" in the resource manager menu> "Folder Options" and click "file example" to find and select "TXT text document ", click "higher", select "always show expansion name", click "OK", and then "closed".) create a text file in d: cvsrootCVSRTOO, edit the file, and set user1 in the following three lines: user1encryptedpassword (the encrypted password is born with the CVSNT device "Generate Passwords", which is included in the installation menu) user2: user2encryptedpassword user3: user3encryptedpassword intervention, career exit, rename the file as passwd (remove the extension name) add three user1 passwords to install wincvs on the same page as user2 password on the same page as user3 password on the same page (download location: :) and run wincvs click "Admin"-> Preferences CVSROOT to change user1 @ myservername: d: cvsroot Authentication select "passwd" file on the cvs server Use vesion select cvs 1.10 (Standard) and then "Admin"-> "Login ", lecheng's return code is 0, and then a module can be imported, and then the module can be checkout. If checkout goes to the same directory, to rename the original directory or delete it, click Create-> Checkout module name and fill in mymodulename Local folder, for example, d: user1. In the Globals page, do not select the other ones for Checkout read-only, click "OK" to checkout. If there is no login, you must first log in once, unless the contents of the event, otherwise you do not need to re-log in.

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.