题记:前段时间用perl写了一个程序,操作中一不小心全部删除了。苦哉!好长时间都没有回过神来。今天回过头来好好使用一个版本控制器。毕竟这是开发根本之所需。
一 quick start
1 installing
下载源文件
tar zxvf cvs.tgz
cd cvs
./configure -prefix=/install_dir
make;make instal
2 building repository
mkdir /somepath/cvsroot
chgrp cvs-grp /somepath/cvsroot
chmod 2775 /somepat/cvsroot
cvs -d /var/lib/cvsroot init
创建仓库文件主目录,更改属组为cvs-grp(待补充说明),设置2775权限,sgid设置的原因是保证/somepath/cvsroot中创建的文件保持与父目录一样的group-id,
3 importing projects
Once you have your initial project structure, add any initial files you want. Change into the root directory of the project. Then, from within that directory, import the project with the command:
cvs -d repository_path import name_of_project vendor_tag release_tag
4 checking out files
cvs -d repository_path checkout project_name
5 commiting changes and updating sandbox
cvs commit
cvs update -d
As the update command runs, it generates a list of files that are modified. To the immediate left of each filename is a single uppercase letter. Those letters report the status of each file listed, and they have the following meanings:
-
Marked for addition but not yet added to the repository (need to run a cvs commit).
-
There was a conflict between the repository copy and your copy. The conflict requires human intervention.
-
Modified in your working directory. The file in the sandbox is more recent than the repository version, or the sandbox and the repository both had changes that the system could safely merge into your sandbox copy (need to run a cvs commit).
-
Patched in the sandbox; similar to U (updated successfully), but in this case CVS sent only the changes, not the entire file.
-
Marked for removal but not yet removed from the repository (need to run a cvs commit).
-
Updated successfully. A newer version in the repository has replaced your sandbox version.
-
The file is in your working directory but not in the repository. CVS doesn't know what to do with it. It's common to see this marker next to temporary or intermediate files that you haven't cleaned up.
A filename
C filename
M filename
P filename
R filename
U filename
? filename
The A, R, and M codes mean that your sandbox contains changes that are not in the repository and it would be a good idea to run a cvs commit.
6 adding files and remove files
touch file3
cvs add file3
cvs commit
rm file3
cvs remove file3
cvs commit
二 建立pserver 让远程client访问
在CVSROOT目录下建立passwd writers readers
create /etc/xinetd.d/cvspserver
service cvspserver
{
port = 2401
socket_type = stream
protocol = tcp
wait = no
user = root
passenv = PATH
server = /usr/bin/cvs
server_args = -f --allow-root=/var/lib/cvs pserver
}
/etc/init.d/xinetd restart
cvs -d :pserver:jenn@cvs_server:/var/lib/cvs login