CVS笔记

"Concurrent Versions System" (CVS) is a version-control system that helps programmers and authors keep histories of their files.

[@more@]

"Concurrent Versions System" (CVS) is a version-control system that helps programmers and authors keep histories of their files.

passwd file

Here is an example passwd file with five entries:

(The passwords are encrypted according to the standard Unix crypt() function, so it is possible to paste in passwords directly from regular Unix /etc/passwd files.)

The first line in the example will grant access to any cvsnt client attempting to authenticate as user anonymous, no matter what password they use, including an empty password. (This is typical for sites granting anonymous read-only access; for information on how to do the "read-only" part, see the section called “Read-only repository access ”.)

 
 
 
 
 
 

cvs chacl theuser:rw dir1 dir2 dir3

创建group file:

group1: user1 user2 user3

group2: me you dognamedblue

group3: peter paul mary

注意:Repository administrators are automatically made a member of the group 'admin'. Don't list this group in the group file.

If SystemAuth = No only the CVSROOT/admin file is checked.

创建readers and writers 文件:

$CVSROOT/CVSROOT/readers file or $CVSROOT/CVSROOT/writers .Here is a sample readers file:

(Don't forget the newline after the last user.)

If readers exists, and this user is listed in it, then she gets read-only access. Or if writers exists, and this user is NOT listed in it, then she also gets read-only access (this is true even if readers exists but she is not listed there). Otherwise, she gets full read-write access.

创建分支(Creating a branch

You can create a branch with tag -b; for example, assuming you're in a working copy:

You can also create a branch without reference to any working copy, by using rtag:

Accessing branches

To check out a branch from the repository, invoke checkout with the -r flag, followed by the tag name of the branch (the section called “Creating a branch ”):

Or, if you already have a working copy, you can switch it to a given branch with update -r:

or equivalently:

Merging from a branch several times

So instead you need to specify that you only want to merge the changes on the branch which have not yet been merged into the trunk. To do that you specify two -j options, and cvsnt merges the changes from the first revision to the second revision. For example, in this case the simplest way would be

Merging differences between any two revisions

With two -j revision flags, the update (and checkout) command can merge the differences between any two revisions into your working file.

 
 

移动和重命名(Moving and renaming files

The Normal way to Rename

The normal way to move a file is to copy old to new, and then issue the normal cvsnt commands to remove old from the repository, and add new to it.

This is the simplest way to move a file, it is not error-prone, and it preserves the history of what was done. Note that to access the history of the file you must specify the old or the new name, depending on what portion of the history you are accessing. For example, cvs log old will give the log up until the time of the rename.

When new is committed its revision numbers will start again, usually at 1.1, so if that bothers you, use the -r rev option to commit. For more information see the section called “Assigning revisions ”.

Moving the history file

This method is more dangerous, since it involves moving files inside the repository. Read this entire section before trying it out!

 
 

When to commit?

It is common to only commit files after making sure that they can be compiled.

File or project status:

1. up-to-date:表示和仓库中的最新版相同

2. locally modified:表示你已经封它修改,但尚未作check in

3. needing patch:表示有人已经放入新版本到仓库中

4. needing merge:表示有人已经放入新版本到仓库中,而你也封自己目录下的文件作过修改

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7200963/viewspace-903640/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7200963/viewspace-903640/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值