CVS manual

zhaozj2021-02-12  174

Copyright Notice: You can reprint anything, please be sure to indicate the original source and author information and this statement by hyperlink. Http://www.chedong.com/tech/cvs_card.html

Keywords: CVS CVSWeb Cvstrac WinCVS CVSROOT

abstract:

CVS is a C / S system that records file versions through a central version control system to achieve the purpose of ensuring the synchronization of files. The working mode is as follows:

CVS server (file repository) / | / (version of the same step) / | / Developer 1 Developer 2 Developer 3

As a general developer pick 2,6, you can read it. CVS administrators need more more, and finally introduce some of the CVS clients under Windows, the choice of CVS remote user authentication and the bug tracking Integration issues for the development environment of the system.

CVS Environment Initialization: CVS Environment Construction Administrator CVS Daily Use: The most common CVS command in daily development, the development of the developer admin CVS, the project is used by different progress and target, and the administrator CVS user authentication: through SSH Remote user authentication, security, simple administrator CVSWeb: CVS web access interface greatly improves code version comparison Efficiency Administrator CVS Tag: Tracking $ ID $ Add Code Comments, Convenient Development Process Tracking Developer CVS VS VSS: CVS And Virsual SourceSafe's comparison developer WinCVS: WinCVS authentication settings based on SSH certified WinCVS certification settings CVSTRAC-based group development environment Construction: CVS user management, integrated bug tracking and Wiki communication CVS through CVSTRAC: Virtual User Management Based on System User CVS Permissions Management and CVSROOT / Passwd

A system 20% of the function is often capable of meeting 80%, and CVS is no exception. The following is the most common function of CVS, may not reach 20% of its all command options, as general developers usually use CVS Update and CVS Commit is enough, more demand will naturally appear in the actual application process, from time to time, look at the relevant documentation often has unexpected gains.

CVS Environment Initialization Environment Settings: Specify the path to the CVS library CVSROOT

TCSHSETENV CVSROOT / PATH / TO / CVSROOTBASHCVSROOT = / PATH / TO / CVSROOT; EXPORT CVSROOT

The settings of remote CVS servers are also mentioned: cvsroot =: ext: $ t t ot = SSH; Export CvsRoot CVS_RSH Initialization: The initialization of the CVS version library. CVS init

The first import of a project CVS IMPORT -M "WRITE Some Comments Here" project_name vendor_tag release_tag execution: import all source files and directories into / Path / to / cvsroot / project_name directory Vender_TAG: Development trademark Release_tag: Version Publishing tag

Project Export: Export code from CVS CVS CHECKOUT Project_nameCVS will create a Project_name directory and export the latest version of the source code to the corresponding directory. This Checkout and VirVual SourceSafe are not a concept. Check out is CVS Update, Check IN is CVS Commit relative to the Check Out of VirVual SourceSafe. Daily use of CVS

Note: After the first export, the file is not synchronized by CVS Checkout, but to enter the version of the specific file in the project_name directory that just exported CVS Checkout Project_Name, the specific file is synchronized (add, modify, delete) operation.

Synchronize files to the latest version CVS Update does not set file names, CVS will synchronize files in all subdirectory, or make a file name / directory to synchronize cvs update file_name is best before you start working or import your work. Before the CVS reservoir, you must have a habit of "first synchronization after modifying", and VirVual SourceSafe, there is no concept of file lock in CVS, all conflicts are solved before commit, if you modify the process, There are other people modified and commit to the CVS library, and CVS will inform you of the file conflict and automatically use the conflict part >>>>> Content on CVS Server <<<<<< Content in your file >>>>>> Mark comes out, by your conflict content. Version conflicts are generally caused by multiple individuals to modify a file, but the problem on this project management should not be expected to be solved by CVS.

Confirmation Modify to CVS CVS Commit -m "Write Some Comments Here" File_Name

Note: Many of the CVS is the final confirmation and modification via CVS Commit, it is best to modify only one file each time. Before confirming, users need to fill in the modified comments to help other developers understand the causes of modifications. If you don't need to write -m "comments", please confirm the `cvs commit file_name`, CVS automatically call the system default text editor (generally VI) to request you to write a comment. The quality of the comment is very important: so we must not only write, but must write some meaningful content: so that other developers can understand bad annotations, it is difficult to let other developers quickly understand: such as: -m "bug mixed" or even -m "" Good note, even in Chinese: -m "to add Email Address Calibration during user registration" to modify a version annotation: only one file to the CVS library each time It is a good habit, but it is inevitable that sometimes I forgot to specify the file name, put multiple files in the same comment to CVS library. The following command can allow you to modify a version of a file: CVS Admin - m 1.3: "Write Some Comments Here" File_Name Adding a file After creating a new file, such as: touch new_filecvs add new_file Note: For the image, Word document, the item, etc., you need to use the CVS Add -KB option to press 2 credit Import (k represents the extension option, b represents binary), otherwise the file destroyed may occur, such as: cvs add -kb new_file.gifcvs add -kb ready.doc If the keyword replacement attribute is set when the first import, how is it? do? CVS admin-kkv new_file.css then confirm the modification and comment CVS Ci -m "Write Some Comments"

Removing a file After deleting a source file, such as: rm file_namecvs rm file_name then confirm the modification and commenting CVS Ci -m "Write Some Comments Here" The first step 2 steps before the upper surface is: CVS RM-F File_namecvs Ci -m Why delete file "Note: Many CVS commands have abbreviations: commit => ci; update => Up; checkout => co / get; remove => rm;

Add Directory CVS Add Dir_Name View Modify History CVS Log File_namecvs History File_Name View Different Version of Different Versions CVS Diff -r1.3 -r1.5 File_Name View Current File (Possible) CVS Diff File_namecvs The web interface provides a more convenient location file modification and comparison version. For details, please see the CVSWEB used later.

Correctly recovering the old version by cvs: If this command is used with cvs update -r1.2 file.name, add a Stick Tag Tag: "1.2", although you just want to return it to 1.2 version correct The recovery version is: cvs update -p -r1.2 file_name> file_name If you accidentally add Stick Tag: Solve with CVS Update -A

The mobile file / file renames CVS has no CVS Move or CVS Rename, because the two operations can be implemented by first CVS Remove OLD_FILE_NAME, then cvs add new_file_name. The most convenient way to delete / move the directory is to let the administrator move directly, delete the corresponding directory in cvsroot (because the subdirectories under the CVS project are independent, can be used as a new independent project as a new independent project: better than one The tree, in fact, it can be cut off independently), and after modifying the catalog, it is required to re-export project CVS Checkout Project_Name or synchronize with CVS Update -DP.

Project release export You may notice when you have developed source files with a CVS directory, and CVS created a CVS / directory under each development directory. There is a file to record the corresponding information between the current directory and the CVS library. But when the project is released, you generally don't want to put the file directory with a CVS directory containing CVS information. This one-time export process uses the cvs export command, but Export can only export for a TAG or date, such as: CVS Export - R release1 project_name cvs export -d 20021023 project_namecvs export -d now project_name

CVS Branch: Project multi-branch synchronous development confirmation version milestones: Multiple files are different, projects to a certain stage, you can assign a stage milestone version number to all files, which is convenient to export items in this stage milestone, while It is also the basis for multiple branches development of the project.

CVS Tag Release_1_0

Start a new milestone: cvs commit -r 2 tag all files start entering 2.x development

Note: The release version of the Revsion and the package in CVS can have no direct relationship. However, all files use and publish version of the version number contribute to maintenance.

When the version branch is established, it is found that there is a problem when the 2.x version of the development project is found, but 2.x does not dare to use, from the previous tagmason: release_1_0 Export a branch release_1_0_patchcvs RTAG -B -R release_1_0 release_1_0_patch proj_dir

Some people lead to the branch of Release_1_0_patch in another directory: Solution 1.0 urgent problems, cvs checkout -r release_1_0_patch, other people are still developing on the main branch of the project 2.x

After fixing the error on the release_1_0_patch, mark a 1.0 error correction version number cvs tag release_1_0_patch_1

If 2.0 thinks these error modifications are also required in 2.0, and can also be modified in Release_1_0_patch_1 in the 2.0 development directory: CVS Update -j release_1_0_patch_1

CVS Remote Authentication Visualization CVS from SSH Remote Access CVS It is very troublesome to PServer remote authentication, you need to define server and user group, user name, set password, etc.

Common login formats are as follows: CVS -D: PServer: CVS_User_name@cvs.server.address: / path / to / cvsroot login example: cvs -d: pserver: cvs@samba.org: / cvsroot login

Not very safe, so it is generally an anonymous read-only CVS access. From safe consideration, through system local account authentication and through SSH transmission is a better way, by setting up in the client / etc / profile: cvsroot =: ext: $ uer@cvs.server.address#port: / PATH / TO / CVSROOT CVS_RSH = SSH; Export CVSROOT CVS_RSH All client users can map to the CVS server corresponding to the same name account. such as:

The CVS server is 192.168.0.3, the CVSROOT path is / home / cvsroot, and another development client is 192.168.0.4. If Tom has the same name on the 2 machines, then set up from 192.168.0.4: Export CVSROOT =: ext: tom@192.168.0.3: / home / cvsrootexport CVS_RSH = sshtom can be carried out directly on the 192.168.0.4 to 192.168.0.3 of cvsroot visit (if you have permission) cvs checkout project_namecd project_namecvs update ... cvs Commit

If the SSH port of the CVS is not in the default 22, or and the client is inconsistent with the CVS server SSH default port, sometimes it is set :: ext: $ uTest.server.address#port: / path / to / cvsroot is still not, such as the following error message: ssh: test.server.address # port: name or service not know [checkout bromorted]: End of File from Server (Consult Above Messages if any) Solving a script Specify port steering (can not use Alias): Can't find a file error): Create a / usr / bin / ssh_cvs file, assume that the SSH port of the remote server is non-default port: 34567 #! / Bin / snow / usr / bin / SSH -P 34567 "$ @" then: chmod x / usr / bin / ssh_cvs and cvs_rsh = ssh_cvs; export cvs_rsh

Note: Port refers to the port of the corresponding server SSH, does not refer to the port of CVS-specific PServer

CVSWEB: Improve file browsing efficiency CvsWeb is the web interface of CVS, which can greatly improve the efficiency of programmers positioning modifications:

Samples can be seen: http://www.freebsd.org/cgi/cvsweb.cgi

CvsWeb Download: CvsWeb has evolved from the initial version to a richer version of the multi-function interface, this is my personal feeling installation settings easier: original: http://www.spaghetti-code.de/software/linux/ CvsWeb /, but currently deleted, you can still download CVSWeb at this site, in fact, the last 2 years of FreeBSD's CVSWeb project has already developed, and the version of FreeBSD is mainly because there is no color file DIFF function. . Download Unpack: TAR ZXF CVSWeb.tgz puts the configuration file cvsWeb.conf to a safe place (for example, in the same directory with the Apache), modify: cvsweb.cgi let CGI find profile: $ config = $ env {'CvsWeb_config'} || '/path/to/apache/conf/cvsweb.conf'; go to / path / to / apache / confation and modify cvsweb.conf: Modify CVSROOT Path Settings:% cvsroot = ('Development '=>' / path / to / cvsroot ', # <== Modification pointing to the local cvsroot; default does not display the deleted document: "hideattic" => "1", # <== default is not displayed Deleted documents can also be customized in the profile cvsWeb.conf, you can modify $ long_intro into the text you need.

CvsWeb can not be open to all users, so you need to use Web User Certification: Mr. Chengwd: / path / to / apache / bin / htpasswd -c cvsweb.passwd user modified httpd.conf: increase

Authname "CVS Authorization"

Authtype Basic

Authorfile /Path/to/cvsweb.passwd

Require Valid-User

CVS Tags: $ ID: CVS_CARD.HTML, V 1.5 2003/03/09 08:41:46 Chedong Exp $ ID: CVS_CARD.HTML, V 1.9 2003/11/09 07:57:11 Chedong Exp $ In the comments of the program file, it is a good habit. CVs can automatically interpret the contents of the update: file_name version time user_name format, such as: cvs_card.txt, v 1.1 2002/04/05 04:24:12 Chedong Exp , Can understand the final modification of the file and modification time

Several commonly used default files: default.php

/ * * Copyright (c) 2002 Company name. * $ Header: /Home/cvsroot/tech/cvs_card.html ,v 1.9 2003/11/09 07:57:11 Chedong Exp $ * /?> ===== =============================== Default.java: pay attention to the file header general notes with / * Start Javadoc Comment / ** Starting / * * Copyright (c) 2002 mycompany name. * $ Header: /Home/cvsroot/tech/cvs_card.html ,v 1.9 2003/11/09 07:57:11 Chedong Exp $ * / package com.mycompany Import java.; / ** * comments here * / public class default {/ ** * comments here * @Param * @return * / public toString () {}} ============ ========================= DEFAULT.PL: !/USR/bin/perl -w # copyright (c) 2002 Company name. # $ Header : /Home/cvsroot/tech/cvs_card.html ,v 1.9 2003/11/09 07:57:11 Chedong Exp $ # file comments here sec; cvs vs vss;

CVS has no file lock mode, and VSS is simultaneously in Check Out, and the file is logged by the exporter.

CVS Update and Commit, VSS is get_lastest_version and check in

The CVS corresponding to the Check Out / undo check out of VSS is Edit and Udit

In CVS, the label automatic update feature is open, which brings a potential problem, which is the time that the file can be expired when the CVS is automatically updated without the -kb mode.

$ Header: /Home/cvsroot/tech/cvs_card.html ,v 1.5 2003/039 08:41:46 Chedong Exp $ $ date: 2003/11/09 07:57:11 $ This mark in Virsual SourceSafe It is called Keyword Explaination, the default is closed, and it is necessary to open through Opition, and specify the file type of the source file keyword scan: *. Txt, *. Java, * .html ...

Tags with Virsual SourceSafe and CVS are: $ header: /Home/cvsroot/tech/cvs_card.html ,v 1.5 2003/03/09 08:41:46 Chedong Exp $$ Author: Chedong $$ Date: 2003 / 11/09 07:57:11 $ REVISION: 1.9 $

I suggest trying to use general keywords to ensure that the code can be easily tracked in CVS and VSS.

WinCVS download: CVS Windows client: Currently stable version is 1.2http: //cvsgui.sourceforge.netssh windows client http://www.networksimumity.com/openssh/ Installed above 2 software: WinCVS client admin = => preference setting 1 Set cvsroot in the General menu: username@192.168.0.123: / home / cvsroot Setup Authorization: Select the SSH Server2 Port Mensen hook: Check for alternate RSH name and set the path of SSH.exe, the default is Put in C: / Program Files / NetworksImplicity / SSH / SSH.exe

Then you can use WinCVS to perform CVS operation, all operations will jump out of the command line window asking you to enter the authentication password of the server.

Of course, if you feel so annoying, there is another way to generate a public key / private key pair without a password, and set the CVS using the public key / private key SSH certification (in the general menu).

You can choose the DIFF tool: http://www.prestosoft.com/examdiff/examdiff.htm or in the WinCVS menu admin ==> Preference's WinCVS menu option: Externel Diff Program and set the path to the DIFF tool, For example,: c: / program files / ed16i / examdiff.exe When the file is sent to the file, the first time you need to select the USE EXTERNEL DIFF in the lower right corner of the window.

CVSTRAC-based group development environment Construction as a small group-level development environment, version control system, and bug tracking system, all involve the user authentication section. How to easily integrate these systems is a very difficult thing, after all, we can't expect Linux to have a very integrated version control / bug tracking integrated system like Source OFFSITE.

I personally oppose the remote user authentication using the PServer mode, but if most of the group members develop by using the Windows client, generally use cvsroot / passwd certification or difficult to avoid, but the management of the user's own users is more troublesome . I planned to write a management interface with Perl until I found CVSTRAC: a web-based BUG tracking system, which hangs the bug tracking system on the CVS system, which includes the cvsroot / passwd file of the web interface. Management, even integrate Wikiwiki discussion group functions.

Here first, the user authentication in CVS's PServer mode is based on inetd: CVSPSERVER STREAM TCP NOWAIT APACHE / USR / BIN / CVS CVS - Allow-root = / home / cvsroot PServer is generally at 2401 Port (this port number is very good: 49 Square) CVS User Database is based on cvsroot / passwd file, file format: [username]: [CRYPT_SYSTEM_USER] Since the password is used by the Unix standard Crypt encryption, this The format of the Passwd file is basically an extension of apache's htpasswd format (more than one system user mapping field than the Apache), so the simplest method of this file can be created with apache / bin / htpasswd -b myname mypassword. Note: The file created by htpasswd will not map the field of the system user, for example: new: gebvosup / zkl2setup: aisqunaoy3qwtest: hwep / bx.redu mapping system user's purpose is: You can create a dedicated CVS service account, such as Apache Run the user apache, and give all permissions in the / home / cvsroot directory to this user, then create different development user accounts in the Passwd file, but develop user account last file read and write permissions are mapped to apache users, in SSH Multiple system development users need to read files in the CVS library in the same group.

Further, you can map users to Apache's system users. New: gebvosup / zkl2: Apachesetup: AisqunaAoy3QW: Apachetest: hWEPZ / BX.REDU: Apache

Cvstrac is well solved the management problem of cvsroot / passwd, and includes the BUG tracking report system and integrated Wikiwiki communication function, and the installation of the CGI mode is installed, and based on the GNU Public License:

Add CVSPSERVER service in inetd: CVSPSERVER STREAM TCP NOWAIT APACHE / USR / BIN / CVS CVS - Allow-root = / Home / CVSRoot PServer

xietd profile:% cat cvspserver service cvspserver {disable = nosocket_type = streamwait = nouser = apacheserver = / usr / bin / cvsserver_args = -f --allow-root = / home / cvsroot pserverlog_on_failure = USERID}

Note: The user here is set to Apache to consistent with all users of / home / cvsroot, and this user must make this user to generate myProj.db generated by using the cvsroot / passwd and CvSTRAC initialization of / home / cvsroot / CVSROJ.DB with read permissions.

Installation process

Download: You can download I use from http://www.cvstract.org. I have been compiled on Linux: cvstrac-1.1.2.bin.gz,% gzip -d cvstrac-1.1.2.bin .gz% chmod x cvstrac-1.1.2.bin # mv cvStarc-1.1.1.bin / usr / bin / cvstrac If it is compiled from http://www.sqlite.org/download.html SQLite's RPM package: rpm -i sqlite-wevel-2.8.6-1.i386.rpm From ftp://ftp.cvstrac.org/cvstrac/ download package unpack, assumption to / home / chedong / cvstrac Under -1.1.2, and plan to install CVSTRAC to / usr / local / bin directory, CD /HOME/CHEDONG/CVSTRAC 1.1.2 edits Linux-gcc.mk: modification: srcdir = / home / chedong / cvstrac 1.1.2installdir = / usr / local / bin then MV Linux-gcc.mk makefilemake # make install initialization CVSTRAC Database: Suppose the database name is MyProj on the CVS server already installed (CVS library should already be initialized, For example: cvs init initialization in / home / cvsroot, running a% cvstrac init / home / cvsroot myproj, there is a MyProj.db library in / home / cvsroot, using cvstrac service, / home / cvsroot / myproj .db / home / cvsroot / cvsroot / read / writers / home / cvsroot / cvsroot / passwd These files should be writable for Web services, on redhat 8, default A Apache user and an Apache group, so set up a web service with Apache users in the httpd.conf file: User apachegroup apache, then set up a apache user and apache group #chown -r apache: apache / home / cvsroot RW-R - R - 1 Apache Apache 55296 Jan 5 19:40 myproj.dbdrwxrwxr-x 3 apache apache 4096 Oct 24 13:04 cvsroot / drwxrwr-x 2 apache apache 4096 Aug 30 19:47 Some_proj / / HOME / CVSROOT / CVSROOT Setting: Chmod 664 Readers Writers Passwd Create a script cvstrac in the APCHE / CGI-bin directory: #! / bin / sh / usr / bin / cvstrac CGI / HOME / CVSROOT Setup script Up: chmod X / Home / Apache / CGI-BIN / CVSTRAC from http: //cvs.server.address/cgi-bin/cvstrac/myproj Enters the management interface default login name: setup password Setup For general users from: http: / /cvs.server.address/cgi-bin/cvstrac/myproj Re-sets the path to the CVSROOT in Setup,

/ home / cvsroot If you are using a PASSWD, Readers, Writers file touch passwd readers Writers, which you need to use in / home / cvsroot / cvsroot, then set it to the Apache user, Chown Apache.apache passwd readers Writers uses setup users to create new users Synchronize update cvsroot / passwd's account modify the login password, perform bug report, etc., more use details can be learned in use.

For the previously mentioned WinCVS set in Perference: cvsroot Bar Enter: username@ip.address.Of.cvs: / home / cvsrootautAuthenitication Selection: Use passwd file on server Side can make CVS from the server.

CVS user rights management

CVS permission management 2 strategies:

System User Management Based on System File Permissions: Suitable for multiple developers using system accounts on Linux. Virtual User Management Based on CVSROOT / Passwd: Suitable for multiple developers on Windows platforms to use account mapped into system accounts. Why use Apache / Apache users? First, it is default in redhat8, and using this user can easily perform Web management via CVSTRAC.

Chown -r apache.apache / home / cvsroot

CHMOD 775 / HOME / CVSROOT

Multiple developers connected to the CVS server on Linux: Shared read and write developers on the Apache group implementation files have system accounts on the development server: SYSUSER1 SYSUSER2, settings let them belong to Apache groups, because new imports from CVS The project is open to group: 664 permissions, so regardless of the project file imported by the system, as long as the group homeship is apache, all other similar system development users can read and write; based on SSH remote authentication is also same.

Apache (System Group) / | / Sysuser1 Sysuser2 Sysuser3

A plurality of developers connected to the CVS server via CVSPServer: Maps Map into an Apache user in the Passwd file to use the CVSROOT / Passwd and Readers Writers for several file management; set all virtual users through CvSTRAC Both are mapped to Apache users.

Apache (System User) / | / WINDEV1 WINDEV2 WINDEV3

With CVS (WinCVS / CVSWEB / CVSTRAC), a relatively perfect cross-platform development version control environment is formed.

related resources:

CVS Home: http://www.cvshome.org

CVS FAQ: http://www.loria.fr/~molli/cvs-index.html Related Website: http://directory.google.com/top/computers/tool/configuration_management/tools/concurrent_versions_system/

CVS - Parallel version of the system http://www.soforge.com/cvsdoc/en_cn/book1.html

CVS free book: http://cvsbook.red-bean.com/

Quick check card for cvs command: http://www.refcards.com/about/cvs.htmlwincvs: http://cvsgui.sourceforge.net/

Cvstrac: a Web-based bug and patch-set tracking system for cvshttp: //www.cvstrac.org

STATCVS: CVS-based code statistics tool: Press the volume, press how http://sourceforge.net/projects/statcvs is planned in Web development by developers: CVS Web Development "in Google

Http://ccm.redhat.com/bboard-archive/cvs_for_web_development/index.html

Some IDE environments integrating CVS:

Eclipse

Magic C

Original source: http://www.chedong.com/tech/cvs_card.html << Back

<< Back to home page

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

New Post(0)