CVS common command speed check manual

xiaoxiao2021-03-06  21

CVS common command speed check manual Blue forest http://www.lslnet.com, September 2, 2002 11:08

Author: Car Dong

Chedong@bigfoot.com

Last updated: 2002-08-30 13:18:41

Copyright Notice: You can reprint anything, please indicate the original source and author information when reproduced.

Overview: CVS is a C / S system, multiple developers record file versions through a central version control system, which achieves the purpose of ensuring the synchronization of the file.

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

The following is the main content of this article: developers can choose 2, 6 can be seen, CVS administrators need more more

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 Comparing by Virsual SourceSafe, a system 20% of the system is often able to meet 80% of the demand. CVS is no exception. The following is the most common function of CVS, which may not be used 10% of it all command options, more Features, please experience in the actual application process, how much it should be used in the learning process, how much is learned, and it is not too late to learn.

CVS environment initialization ============

Environmental Settings: Specify the path of the CVS library CVSROOT TCSH STENV CVSROOT / PATH / TO / CVSROOT BASH CVSROOT = / PATH / TO / CVSROOT; EXPORT CVSROOT

The settings of the remote CVS server are also mentioned: cvsroot =: ext: $ t@test.server.address#port: / path / to / cvsroot cvs_rsh = ssh; export cvsroot CVS_RSH

Initialization: Initialization of the CVS repository. 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_name CVS 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.

CVS daily use =============

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 working your work. Before importing into the CVS reservoir, and develop the habit of "first synchronization after modification", and virVual SourceSafe, there is no concept in CVS, all conflicts are solved before commit, if you modify There are other people modified and commit to the CVS library, and CVS will notify you to conflict with the conflict and automatically use the conflict part >>>>> Content on CVS Server <<<<<< Content in your file >>>>> > Tagged out and confirm the content of 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 Modification Writing to CVS Curre: 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 Fixed" Even -M "" Good Note, and even in Chinese: -m "adds an Email address check in the user registration process."

Modifying a version Note: Every time you only confirm that a file is a good habit, it is inevitable that sometimes I forgot to specify the file name, put multiple files to CVS library, the following command can be Allow you to modify a version of a file: cvs admin -m 1.3: "Write Some Comments Here" File_Name

After adding a file to create a new file, such as: Touch new_file cvs add new_file Note: For the image, Word document, etc. Items, you need to use the cvs add -b option, otherwise the file is destroyed, such as: CVS AddD -kb new_file.gif then confirm the modification and comment CVS CI -M "Write Some Comments"

Delete file: After physical deletion of a source file, such as rm file_name cvs rm file_name then confirm the modification and comment CVS Ci -m "Write Some Comments Here" More than 2 steps before the upper surface is: CVS RM -F File_Name CVS CI -m "why delete file" Note: Many CVS commands have abbreviations: commit => ci; update => Up; checkout => co; remove => rm;

Add Directory: CVS Add Dir_name

View Modify History: CVS log file_name cvs history file_name

View the difference between the current files CVS diff -r1.3 -r1.5 file_name View the current file (may have been modified) and the difference between the corresponding file in the library provides more convenient positioning file modifications and Method for comparing version difference, specific installation settings, please look at the CVSWEB used

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

Mobile file: The file is renamed CVS without CVS Move or CVS Rename, because the two operations are first cvs remove ly_file_name, then CVS add new_file_name is implemented.

Delete, moving directory: The most convenient way 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: A tree, in fact, it is independently survived. After modification of the catalog, it is required to re-export project CVS Checkout Project_Name or synchronize with CVS Update -DP.

CVS BRANCH: Project multi-branch synchronous development ==============================

Confirmation version milestones: Multiple files are different, projects to a certain stage, you can assign a phase milestone version number to all files, which is convenient to export projects in this stage milestone, and multiple branches developed by the project. basis. 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 2.x version of the project is discovered 1.x, but 2.x does not dare to use, from the previously tagmasonry: Release_1_0 Export a branch release_1_0_patch cvs RTAG -B -R release_1_0 release_1_0_patch proj_dir some people first In another directory exports this branch: Resolve the emergency problem in 1.0, cvs checkout -r release_1_0_patch, other people are still developing on the main branch of the project.

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

Remote authentication of CVS: Remote Access CVS by SSH ================================

Remote authentication using CVS itself is cumbersome, you need to define server and user groups, user names, setting passwords, etc., and are not safe, so the system local account authentication and through SSH transmission are better ways, through the client / ETC / profile sets the content: cvsroot =: ext: $ tTest.server.address#port: / path / to / cvsroot CVS_RSH = SSH; Export CvsRoot CVS_RSH All client All local users can map to CVS servers Account.

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 set:: ext: $ u@test.server.address#port: / path / to / cvsroot

Still not, such as the following error message: ssh: test.server.address # port: name or service not know CVS [Checkout Aborted]: End of File from Server (Consult Above Messages IF ANY)

The solution is to do a script specified port steering (can not use Alias, you can't find a file error): Create a / usr / bin / ssh_cvs file: #! / Usr / bin / sh / path / to / 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, not the port of CVS PServer

CvsWeb: Improve programmers compare file modification efficiency =================================

CvsWeb is a CVS web interface that greatly enhances the efficiency of programmers to locate modifications: Use of the sample: http://www.freebsd.org/cgi/cvsweb.cgicvsWeb Download: CVSWeb from the initial version has evolved Many functional interfaces are richer, this is a personal feeling that the installation setting is convenient: http://www.spaghetti-code.de/software/linux/cvsweb/

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 = ('develop' => '/ path / to / cvsroot', # <== Modify pointing to local cvsroot); default does not display documents that have been deleted: "HideAttic" => "1 ", # <== default, the deleted document can also be customized in the profile cvsWeb.conf, you can modify $ long_intro to become the text CVSWeb you need, can not be open to all users, so Need to use Web User Certification: Mr. Chengwd: / path / to / apache / bin / htpasswd -c cvsweb.passwd user

Modify httpd.conf: Add Authname "CVS Authorization" Authty Basic AuthiSerfile /Path/to/cvsweb.passwd Require Valid-User

CVS Tags: who? When? =====================

It is a good habit of adding $ ID $ to the beginning of the program file. CVS can automatically explain 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, you can learn about the final modifier and modification time of the file

Several commonly used default files: default.php

?>

=================================================== Note from / ** Start / * * Copyright (c) 2002 Company Name. * $ Header $ * / package com.netese

Import java.io;

/ ** * comments here * / public class default {/ ** * * @Param * @return * / public toString () {

}

============================================ DEFAULT.PL: #! / usr / bin / perl -w # Copyright (c) 2002 Company name. # $ Header $

# File Comments Here

Use strict;

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 is Update Commit, VSS is Check Out CHECK IN

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.

This feature in Virsual SourceSafe is called Keyword Explaination, the default is off, you need to open through OPition, and specify the type of source file keyword scan: *. Txt, *. Java, *. Html ...

For Virsual SourceSafe and CVS, Tags are: $ head $ $ Author $ $ $ $ revision $

Try to use a general keyword to ensure that the code can be easily tracked in CVS and VSS.

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/software/configuration_management/tools/concurrent_versions_system/

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

Quick check card for cvs command: http://www.refcards.com/about/cvs.html

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

New Post(0)