您的位置:軟件測試 > 開源軟件測試 > 開源配置管理工具 > cvs
cvs常用命令
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2013/1/14 13:51:05 ] 推薦標(biāo)簽:

工作思路:
在一臺服務(wù)器上建立一個代碼倉庫(repository),其中存放了許多項(xiàng)目的源程序,由管理員管理這些源程序,
每個用戶在使用倉庫前,把倉庫里的項(xiàng)目文件下載到本地,先在本地修改,然后用cvs命令提交.

CVS在SCCS和RCS的基礎(chǔ)上開發(fā)
CVS Concurrent Version System
SCCS Source Code Control System
RCS Revision Control System

工作思路:
在一臺服務(wù)器上建立一個代碼倉庫(repository),其中存放了許多項(xiàng)目的源程序,由管理員管理這些源程序,
每個用戶在使用倉庫前,把倉庫里的項(xiàng)目文件下載到本地,先在本地修改,然后用cvs命令提交.

1.服務(wù)端
# groupadd cvs
# useradd cvsroot -g cvs -s /sbin/nologin
[cvsroot@]$ chmod 771 .
[cvsroot@]$ cvs -d /home/cvsroot init
加入到xinetd啟動
/etc/xinetd.d/cvspserver
service cvspserver
{
 socket_type = stream
 wait  = no
 user  = root
 server  = /usr/bin/cvs
 server_args = -f --allow-root=/home/cvsroot pserver
 log_on_failure += USERID
}
# chmod 644 cvspserver
# service xinetd restart
編輯/etc/group加入可以使用CVS的用戶名
cvs:x:501:iry,iryshe

2.客戶端
$ export CVSROOT=:pserver:iry@192.168.1.1:/home/cvsroot
$ cvs login
or
$ cvs -d :pserver:iry@192.168.1.1:/home/cvsroot

3.管理CVS服務(wù)器
在/home/cvsroot/CVSROOT中有三個配置文件: passwd, readers, writers
passwd: cvs用戶列表文件
{cvs username}:[encrypted password]:[等效的系統(tǒng)用戶名]

4. 操作
$ cvs 動作 文件名
動作: login, logout, commit, checkout, update, status, diff, log, add, remove
eg. cvs diff -c index.php
如果不指定文件名,則cvs會操作當(dāng)前目錄下所有的文件和子目錄

新增文件:
a. edit a new file
b. cvs add filename
c. cvs commit filenmae -m ""

新增目錄:
a. mkdir dirname
b. cvs add dirname

刪除文件:
a. rm filename
b. cvs remove filename
c. cvs commit -m "" filename

刪除目錄:
a. cd dirname && rm * -f
b. cvs remove *
c. cvs commit -m "" *
d. cvs update -P //告訴cvs服務(wù)器刪除空目錄

更改文件名:
a. mv oldfile newfile
b. cvs remove oldfile
c. cvs add newfile
d. cvs commit -m "" oldfile newfile

新建CVS項(xiàng)目:
a. cd php-project
b. cvs import -m "" php-project v_1_0_0 start

軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd