CVS common command speed check manual

xiaoxiao2021-03-06  106

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 version library) / | / (version of the same step) / | / Developer 1 Developer 2 Developer 3 Developers Getting Started can mainly pick 2,6, you can, CVS administrators The more need more, and finally introduces some of the CVS clients under Windows, the selection of remote user authentication, and integration issues with the BUG tracking 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's web access interface greatly improves the efficiency Administrator CVS Tag: Add $ Header $ Add to Code Comments, Convenient Development Process Tracking Developers CVS VS VSS: CVS And Virsual SourceSafe's comparative developer administrator WinCVS: CVSTRAC-based Group Development Environment Based on SSH-certified WinCVS certification settings: CVS user management and integrated bug tracking and Wiki communications are implemented by cvstraac. A system 20% of the system is often capable of meeting 80% of the demand, and CVS is no exception. The following is the most common function of CVS, may not reach 20% of its all command options, more features experience in the actual application process, How much do you want to use, you will look back from time to look at the unexpected gain. CVS environment initialization ============ Environment settings: Specify the path of the CVS library CVSROOTTCSHSETENV CVSROOT / PATH / TO / CVSROOTBASHCVSROOT = / path / to / cvsroot Export CVSROOT also refers to the settings of the remote CVS server: Cvsroot =: ext: $ u tTest.server.address#port: / path / to / cvsroot CVS_RSH = SSH; Export CvsRoot CVS_RSH Initialization: The initialization of the CVS version library. CVS INIT's first imported CVS import -m "write some" process_name vendor_tag release_tag executed: will import all source files and directories to / 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.

CVS daily use ============= Note: After the first export, it is not synchronized by CVS Checkout, but to enter the project_name directory exported by CVS Checkout Project_name. The version of the 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 Modification Writing to CVS CVS Commit_name Note: Many of CVS is confirmed by CVS Commit, and it is best to modify 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 Way import (k represents the extended option, b represents binary), otherwise the case where file is broken, such as: cvs add -kb new_file.gifcvs add -kb readme.doc and confirm the modification and comment CVS Ci -m "Write Some Comments "Remove the file After the file is physically deleted, for example: rm file_namecvs rm file_name then confirm the modification and comment CVS Ci -m" Write Some Comments Here "The above two steps of the above surface merges: cvs rm -f file_namecvs Ci - M "why delete file" Note: Many CVS commands have abbreviation form: 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 the difference between the current files Different versions CVS Diff -r1.3 -r1.5 file_name View the current file (may have been modified) and the different files in the library CVS Diff file_namecvs' web interface provides more convenient positioning file modifications and Comparison Version Differences, Specific installation settings See the back CVSWeb Use the correct way to restore the old version of the old version by cvs: If you use the cvs update -r1.2 file.name this command is added to file.name Add a S Tick ​​Tag: "1.2", although your original intention just wants to return it to 1.2 version correct recovery version of the version is: cvs update -p -r1.2 file_name> file_name If you accidentally add Stick Tag: CVS Update -a solves the mobile file / file rename CVS without CVS Move or CVS Rename, because the two operations can be implemented by first cvs remove ly_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_namecvs 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 starts a new milestone: CVS commit -r 2 tag all files start entering 2.x Development Note: The release version of the Revsion and 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 first export 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 2.x of the project to fix an error after fixing the error on the Release_1_0_patch, marked a 1.0 Error Correction version number CVS Tag Release_1_0_patch_1 If 2.0 Think these error modifications are also required in 2.0, it is also possible to combine the modifications in Release_1_0_patch_1 in the 2.0 development directory: CVS Update -j release_1_0_ps Update -j release_1_0_patch_1cvs remote authentication: remote access by SSH CVS ================================ Using CVS itself based on PServer remote authentication is cumbersome, you need to define server and user groups , 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 is 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.

For example: 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 it up from 192.168.0.4. : export CVSROOT =: ext: tom@192.168.0.3: / home / cvsrootexport CVS_RSH = sshtom can cvsroot of 192.168.0.3 is directly accessible on the 192.168.0.4 (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 with the client and the CVS server side default port is inconsistent, it is sometimes set :: ext: $ u@test.server.address#port: / Path / to / cvsroot is still not, such as the following error message: ssh: test.server.address # port: name or service not knowncvs [checkout bromted]: End of File From Server (Consult Above Messages if any) Solution method is Do a script specified port steering (you can't use Alias, you can't find file error): Create a / usr / bin / ssh_cvs file: #! / Usr / bin / sh / path / to / ssh -p 34567 "$ @ @ "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 file browsing ========= ============== CVSWeb is the WEB interface of CVS, which can greatly improve the efficiency of programmers positioning modifications: Use the sample: http://www.freebsd.org/cgi/ CvsWeb.cgi

CVSWeb Download: CvsWeb has evolved from the initial version to have a richer version of the function interface, this is the convenient installation setting:

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 = ('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 all the text CVSWeb you need, can not be open to all users, so you need to use Web User Certification: Mr. is Passwd: / Path / to / apache / bin / htpasswd -c cvsweb.passwd user modified httpd.conf: Add Authname "cvs authorization" Authty BasicauthuserFile / Path / To /cvsweb.passwdrequire valid-user cvs tags: who? when? ==================== 将 在 程序 程序 程序 注Is a good habit, CVS can automatically explain the contents of the update to: 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 files The final modification of the people and the modification time several commonly used default files: default.php ========== ========================== Default.java: pay attention to the file header General Note / * Start Javadoc Note / ** * * Copyright (c) 2002 mycompany name. * $ Header $ * / 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. # $ # # File comments here ==================== CVS has no file lock mode, and VSS is simultaneously in Check Out while logging the file being locked. CVS's Update and Commit, VSS is Get_lastest_Version and Check IN CHECK OUT / undo check out's CVS in the CVS of EDIT and UNEDIT in CVS, tag automatic update features are open, which also brings a potential problem If you don't have to add a binary file without the -kb method, you may cause file failure when CVS is automatically updated. $ HEADER $ DATE $ TIST Solving KEYWORD EXPLAINATION in Virsual SourceSafe, the default is off, you need to open through Opition, and specify file types that need to perform source file keywords: *. Txt, *. Java , *. html ... For Virsual SourceSafe and CVS Tags are: $ head $$ Author $$ Date $ $ Revision $ I suggest trying to use universal keywords to ensure that the code can be tracked in CVS and VSS. WinCVS ====== Download: CVS Windows client: Currently stable version is 1.2http: //www.wincvs.org/

SSH Windows client

http://www.networksimumity.com/openssh/

After installed 2 software: WinCVS client's admin ==> preference setting 1 Set cvsroot in the General menu: username@192.168.0.123: / home / cvsroot Setup Authorization: Select SSH Server2 Port Menior hook: Check for alternate RSH name and set the path to SSH.exe, the default is to install the C: / SSH / SSH.exe and then use WinCVS to perform CVS operation, all operations will jump out of the command line window asking you to enter the server. Authentication password. 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: ExamDiff Download:

http://www.prestosoft.com/examdiff/examdiff.htm

Still in WinCVS menu admin ==> Preference's WinCVS menu, EXTERNEL DIFF Program and set the path to the DIFF tool, such as: c: / program files / ed16i / examdiff.exe, when the file is sent to the file, the first time Need to select the User Externel Diff in the lower right corner of the window. CVSTRAC-based group development environment built =============================== as a group-level development environment, version control system and bug Tracking systems, etc. 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 the CVS PSERVER mode is based on inetd: CVSPServer Stream TCP NOWAIT NOBOWDY / USERVERVERVS - ALLOW-ROOT = / home / cvsroot PServer is generally at 2401 Port CVS User Database is based on cvsroot / passwd file, file format: [username]: [mapping_ssword]: [mapping_system_user] Since the password is used by the Unix standard Crypt encryption, this Passwd file format is basically Apache's htpasswd format. Extended (one system user mapping field than 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: hWEPZ / BX.REDu mapping system user's purpose is: You can create a special CVS service account, such as CVS 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 CVS users, avoiding in SSH mode Multiple development users read and write permission issues for other users after new files. Further, you can map the user to 2 groups, using 2 users' permissions settings to avoid access to each other with each other.

New: Gebvosup / zkl2: Proj1setup: AisqunaAoy3QW: Proj2test: hwez / bx.redu: Proj1 Cvstrac Very good to solve the management problem of cvsroot / passwd, and contain bug tracking reporting system and integrated Wikiwiki communication function, using CGI mode Installation, and Based on GNU Public License: Installation Download: You can from http://www.cvstrac.org

Download I use it is already compiled on Linux: cvstrac-1.1.1.bin.gz,% gzip -d cvstrac-1.1.1.bin.gz% chmod x cvstrac-1.1.1.bin #mv cvstarc-1.1.1.bin / usr / bin / cvstrac Initialization CVSTRAC Database: Suppose the database name is MyProj on the already installed CVS server (CVS library should already be initialized, such as: cvs init initialization / home / cvsroot, running a% cvstrac init / home / cvsroot myproj, there will be a MyProj.db library in / home / cvsroot, using cvstrac service, / home / cvsroot / myproj.db / home / cvsroot / Cvsroot / readers / home / adoot / cvsroot / writers / home / cvsroot / cvsroot / passwd These files should be writable for Web services, on redhat 8, there is a Apache user and one by default. Apache group, so I set up a web service with Apache users in httpd.conf file: User apachegroup apache, if the Apache on the server is other users, such as: Nobody NogRoup runs, then the user / group in the following configuration Set to Nobody Nogroup and then I set up #chown -r apache: apache / home / cvsroot-rw-r - r - 1 apache apache 55296 Jan 5 19:40 myproj.dbdrwxrwr-x 3 Apache Apache 4096 Oct 24 13: 04 CVSROOT / DRWXRWR-X 2 Apache Apache 4096 AUG 30 19:47 Some_proj / Also set in / home / cvsroot / cvsroot: 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 Execution: Chmod X / Home / Apache / CGI-BIN / CVST Rac from

http://cvs.server.address/cgi-bin/cvstrac/myproj

Enter the management interface default login name: setup password Setup can be from:

http://cvs.server.address/cgi-bin/cvstrac/myproj

Modify the login password, perform BUG reports, etc., more use details can be learned in use. Note: cvspserver added services in inetd: cvspserver stream tcp nowait apache / usr / bin / cvs cvs --allow-root = / home / cvsroot pserverxietd 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 all users of / home / cvsroot, and must make this This user has read permissions for myProj.db generated by cvsroot / passwd and CVSTRAC under / home / cvsroot /. 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 export projects from the server. Summary: Use CVS (WinCVS / CVSWeb / CvSTRAC) to form a relatively complete cross-platform development version of the control environment. 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

WinCVS:

http://cvsgui.sourceforge.net/

Cvstrac: a web-based bug and patch-set tracking system for cvs

http://www.cvstrac.org

Statcvs: CVS-based code statistics tool: according to the amount, according to the developer's statistics table, etc.

http://sourceforge.net/projects/statcvs

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

New Post(0)