CVS manual for details

xiaoxiao2021-03-06  195

CVS Environment Initialization Environment Setting: Specify the path of the CVS library CVSROOT TCSHSETENV CVSROOT / PATH / TO / CVSROOTBSROT / PATH / TO / CVSROOTBASHCVSROOT = / path / to / cvsroot; Export CVSROOT also refers to the settings of the remote CVS server: cvsroot =: ext: $ user @ Test. Server.address # port: / path / to / cvsroot cvs_rsh = ssh; Export CvsRoot CVS_RSH Initialization: The initialization of the CVS repository. 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. CVS daily use Note: After the first export, it 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 version 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 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 that CVS CI -M "Write Some Comments" deletes files After deleting a source file, such as: rm file_namecvs rm file_name and confirm the modification and comment CVS Ci -m "WRITE Some Comments Here "Merged by 2 steps above the upper surface: 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 current files Different versions CVS Diff -r1.3 -r1.5 file_name View current files (may have been modified) and library The difference between the corresponding file CVS DIFF FILE_NAMECVS web interface provides a more convenient location file modification and comparison version of the method, the specific installation settings, see the following CVSWeb Use the correct way to restore the old version of the old version: If you use CVS Update - R1.2 file.name This command is given to file.name plus a Stick Tag: "1.2", although your originality just wants to recover it to 1.2 version correct recovery version is: cvs update -p -r1.2 File_name> file_name If you accidentally add Stick Tag: Use CVS Update -a to resolve the mobile file / file rename CVS without CVS Move or CVS Rename, because the two operations can be first cvs remove old_file_name, then CVS AddD New_file_name is implemented.

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, project to a certain stage, you can give all files to specify a stage milestone version Number, it is convenient to export projects in this stage milestone, and is also the basis for multiple branch development of the project. 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, labeled 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, or in the 2.0 development directory, the modifications in Release_1_0_patch_1 in the 2.0 development directory can also be modified to the current code: CVS Update -j release_1_0_patch_1 CVS remote authentication via SSH Remote Access CVS uses CVS itself based on PServer remote authentication. You need to define server and user groups, user names, setting passwords, 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 (can not use Alias, you 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 / sm / 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 CVSWeb of the CVS-specific PServer: Increasing file browsing efficiency CvsWeb is the web interface of CVS, which can greatly improve the efficiency of programmer positioning modifications: use the sample: http://www.freebsd.org/cgi/cvsweb.cgi cvsweb download: cvsWeb from the original The version has already evolved a lot of functional interfaces, this is my personal feeling installation settings. Easy: Originally: http://www.spaghetti-code.de/software/linux/cvsweb/, but currently deleted At present, CVSWeb can still be downloaded on this site. In fact, the last 2 years of FreeBSD's CVSWeb project has a better development, 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 = ('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" AuthType BasicAuthUserFile /path/to/cvsweb.passwdrequire valid-user CVS TAGS: $ Id: cvs_card.html, v 1.5 2003/03/09 08:41:46 chedong Exp $ the $ Id : cvs_card.html, v 1.9 2003/11/09 07:57:11 CHEDONG EXP $ 加 加 加 很 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容 内容Format, such as: CVS_CARD.TXT, V 1.1 2002/04/05 04:24:12 Chedong Exp, you can learn more about the file's final modification and modification time: default.php ====== ============================== DEFAULT.JAVA: Note the file header General Note Use / * Start Javadoc Note Use / ** Start Differences / * * CopyRight (C) 2002 Myc Ompany 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 Hereuse Strict; CVS vs vss CVS No file lock mode, VSS simultaneously in Check OUT, and logs that the file is 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: /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 known to be Keyword Explaination, the default is closed, you need to open through Opition, and specify the file type of the source file keyword scan: *. Txt, *. Java, * .html ... for Virsual SourceSafe and CVS General TAG is: $ 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 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 are jumped out of the command line window asking you to enter the authentication password for 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 by cvsroot / passwd management issues, including bug tracking reporting system and integrated Wikiwiki communication function, etc., use CGI mode Installation, and Based on 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's purpose is to / home / cvsroot All users are consistent, and this user must be generated by the user / cvsroot / CVSROOT / PassWD and CVSTRAC initialization. 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 / cvsrootchmod 775 / home / cvsroot Linux with multiple developers connected to CVS servers through SSH: Shared read and write developers on the Apache group implementation files on the system account: SYSUSER1 Sysuser2, settings let them belong to the Apache group, because the newly imported items through the CVS are open: 664 permissions, so regardless of the system user imported project file, as long as the file is the group, which is the Apache, all other groups System development users can read and write; the same is true based on SSH remote authentication. Apache (System Group) / | / Sysuser1 Sysuser2 Sysuser3 Windows Multiple Developers Connect to CVS Servers through CVSPServer: Maps Maps in Passwd Files into Apache users to implement files Share read and write their account through cvsroot / passwd and readers Writers this Several file management; setting all virtual users through CVSTRAC to map to Apache users. Apache (System User) / | / WINDEV1 WINDEV2 WINDEV3 makes a relatively complete cross-platform development version 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-- concurrent versions system http://www.soforge.com/cvsdoc/zh_CN/book1.html CVS free book: http: //cvsbook.red-bean.com/ CVS command to check the card: http://www.refcards.com/about/cvs.html wincvs: http: //cvsgui.sourceforge.net/ cvstrac: a web-based bug and patch tracking system for cvshttp: //www.cvstrac.org Statcvs: CVS-based code statistics tool: Press the code quantity, press how http://sourceforge.net/projects/statcvs is planned in Web development in WEB development: on Google Check "CVS Web Development" http://ccm.redhat.com/bboard-archive/cvs_for_web_development/index.html Some integrated CVS IDE environment: Eclipsemagic C

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

New Post(0)