Bricks with gnu & linux
====================
Getting Started CVS is a version control system. In UNIX, use it to record changes on the source file, you can record version transformations, who has modified what. And can manage the source file from it The versions of a certain revision can be extracted. It not only can be used on a stand-alone, but also CVS can work together with collaboration, and operate the same project. CVS is like this: CVS reserves a first source The copy of the file, this copy is called "repository", which is probably "source". Since then, the operation of all source files must be performed under the control of CVS, and no longer operate the original source file. That is, the modifier should copy the copy of the copy from the source file under the CVS control, and the modification of the source file is recorded by CVS. CVS command and the parameters, but the commonly used commands are only 5 (CVS Checkout, CVS Update, CVS ADD, CVS RM, CVS Commit). Here you will introduce:
Before the CVS is able to work, first make some settings, create a environment variable called CVSRoot, this environment variable is used to describe the root directory of CVS, which is the root directory of the data source. CVS is initialized to initialize this directory :
CVS init
When initialization, an account called CVS can be created, which is used to initialize and manage CVS.
After initialization, an engineering can be introduced to enter the directory where the project is located, such as / myproject, use:
CD / MyProject
CVS import -m "imported by me!" Project Me Release1
To introduce a project, introduce the / myproject and its subdirectory together, "- m" represents Messages, record some modifications. Parameter Project's role is the deposit source file established in the $ cvsroot directory Directory name, ME represents Vendor-tag, release1 represents release-tag, after which people interested in this project can copy their own modification, use:
CVS Checkout Project
To export this project, you can export different versions, different dates modified projects, which requires additional parameters after CVS Checkout Projects. Simple CVS Checkout Project can export the latest engineering version to your current directory. In some cases, export files will encounter some difficulties, such as file read and write permissions, make it unreportable. The general solution is to place all users involved in collaborative work in the same group and enable $ cvsroot (including all files in the directory) to make the members of this group to read and write permissions.
When a user modifies the file, use the following command to update the project:
CVS Commit Files
Use a file or directory, use:
CVS add myfile is updated
Delete a file or directory, use
CVS RM MyFile is updated
But the two of the above orders only take effect immediately in CVS COMMIT Myfile.
CVS Update is used to export the latest version from the source of engineering to replace existing projects.
Let's talk about a more complicated example, assuming that in the process of editing the source file, I feel that the modification is not necessary, I want to restore the original version, so that you can:
% cvs init
% cvs import -m "imported by me!" Project Me Release1 "
Introduced source file
% CD MyHome
% CVS Checkout Project
% CD Project
% CVS Tag OldVersion *
The above is a TAG for existing source files.
% CVS Add Myfile
% cvs commit myfile has modified something
But now I don't want this new file or don't want these changes, you can:
% CVS Checkout -R OldVersion
You can restore it.
As for each user who disperses the individual users on multiple machines, some configuration files need to be modified, first ensuring such a service in / etc / services:
CVSPSERVER 2401 / TCP
CVSPSERVER 2401 / UDP
Then modify /etc/inetd.conf, join a line:
CVSPSERVER STREAM TCP NOWAIT ROOT / USR / BIN / CVS CVS - Allow-root = CVSROOT_OF_YOURS PSERVER
Assume that users from Host1 want to get a copy from the Host0 machine, first use:
CVS -D: PServer: Your_username @ Host0: / cvsroot_of_host0 login
Log in, then you can use CVS like this machine.
Some of the simplest methods described above, CVS is actually a very miscellaneous tool, which can be meticulous control, including file lock, etc. according to the parameters it provides. The complete CVS command is as follows: CVS [CVS_OPTIONS] CVS_COMMAND [Command_Options] [Command_args] can be used to see the detailed usage of each command with CVS -H Command. This article is written very simple, detailed information can be referred to "/usr/doc/cvs../cvs.ps" file.
Koun 1999.9.6