CVS notes

xiaoxiao2021-03-06  41

I have read the book of Essential CVS, combined with a few articles on the Internet, note the note one, cvs basic concept

1, Repository

CVS server side file warehouse

2, SANDBOX

User Local File Warehouse

3, TAG

Tag, used to identify different versions

4, Branch

Branch, can be divided into main branches and secondary branches, both can develop independently (able to commit to repository)

USAGE:

Major version, in addition to BUG, ​​independent development

5, HEAD

Current repository library

6, Base

Repository library file relative to Sandbox

7, Sticky

WHEN A File in a Sandbox Has a persistent state..

Any file or directory for Checkout, Update, with Tag, Revision Number, and Date (these called sticky) cannot be used in HEAD.

Second, operation

1, initialization library

CVS init

2, set CVSROOT Environment Variable

If the local repository Path is set cvsroot = d: / cvsrepo / xxxx

3, build library

On the directory to be uploaded

CVS import. -C

5, login

CVS -D: Access protocol: Username @ 密号: Server Address: Library path

EG:

CVS -D: PServer: ricky @ xxx: localhost: / cvsrepor / xxxx

6, load from repository to Sandbox

CD to the Sandbox directory for Checkout

CVS Checkout Tagname

EG

CVS Co

7, plus users

CVS Passwd -a User Name -R and System Account Alias

8, change the authority

CVS Chacl -R (Remature) -R (DEFAULT) User Name: [R | W | C | N] (Permissions) Directory Name

9, synchronization

CVS Update.

After the first Check OUT, you must use Update, first Update, and then modify it.

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 of the version is: cvs update -p -r1.2 file_name> file_name

CVS update -r revision -p> filename If you accidentally add Stick Tag: Use CVS Update -a to resolve

Retrieve the past version

Step 1: CVS log, view past TAG

Step2: Update Sandbox file

Calling cvs update with the -r or -D options downloads a static, unchangeable copy of the file or files to the sandbox. Such files can be useful to view past data, but changes to these files can not be committed to the repository.

The static files have a mark, called a sticky tag or a sticky date, in the Entries file in the CVS subdirectory of the current sandbox directory. The command cvs update -A removes the sticky tags or dates and replaces the files with the latest revision from the repository. CVS attempts to merge any changes you have made to the sandbox copy into the copy it retrieves from the repository.If you make changes to a static revision and want to commit the changed file to the repository as a new revision, create A Backup of the Changed File, Use CVS Update -a To Clear The Sticky State, Replace The File That Update Created with the feed. And the cvs commit

10, submit

CVS commit filename | Directory

11, delete

CVS RM FileName | Directory

12, increase

CVS Add filename | Directory

13, tag

CVS TAG TAG name

cvs tag determines which files and revisions to mark based on your sandbox, but it marks them based on the revision that was most recently synchronized with the repository. If changes have occured in the sandbox since the files were last synchronized with the repository, those changes Will NOT BE Reflected in The Tagged Revisions.

The -c command option to cvs tag allows you to check whether your sandbox files have been modified and not committed before you tag the files. If cvs tag -c finds uncommitted changes, it will stop without tagging any files. If you want to tag ........................... ..

Building Branch, first commit, add parameters in tag -B

Good advice: tagging before branching

It is good practice to tag the trunk just before splitting off a branch, because this makes it easier to merge the changes back later. To be absolutely certain that the revisions tagged with the prebranch tag are the revisions used as the base of the branch, use cvs rtag -r prebranch-tag -b branch-tag project to create the branch. This command uses the prebranch tag to specify the revisions the branch is created fromBranch creation occurs in the repository, not the sandbox. to edit the branch Revisions of the files, you need to check out a branch sandbox or us Update to ALTER The Current Sandbox To The Branch.

14. Project release export source file without cvs directory

When you are developing, you may notice that in each development directory, CVS creates a CVS / 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_name

CVS export -d now project_name

15, branch example

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.

Establishment of version branches

When the 2.x version of the project is discovered 1.x there is a problem, but 2.x does not dare to use, from the previously tagmate: 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 export Release_1_0_patch in another directory: solve the problem of emergency in 1.0,

CVS checkout -r release_1_0_patch

Other people are still developing on the main branch of the project.

After fixing an 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 made in the 2.0 development directory to modify the modifications in Release_1_PATCH_1 to the current code:

CVS Update -j release_1_0_patch_1

16, combined branch and main branch (Trunk)

Advice: When You Merge A Branch, It is Good Practice to Tag The Branch At The Merge Point.

Third, attribute

CVS port 2401

2005-02-01

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

New Post(0)