Posted on 2009-02-09 12:11
Prayer 閱讀(1259)
評(píng)論(0) 編輯 收藏 引用 所屬分類:
CVS
cvs基本命令
checkout (co)
cvs checkout java_test
diff
查看差異
cvs diff test.c
cvs diff -c test.c
用編輯器查看
Admin-〉Preferences-〉wincvs
commit
提交
Log
查看日志
版本回退
方法1
cvs (-Q) update -p -r 1.2 test.c > test.c
方法2
cvs update -j 1.3 –j 1.2 test.c
//cvs up –A test.c
模塊設(shè)定
CVSROOT文件夾下的module文件上寫入
代號(hào) 路徑
如:acctmgmt project/acctmgmt
排除目錄
如:acctmgmt !project/acctmgmt/doc project/acctmgmt
聚合多個(gè)目錄
如:linux_kernel –a init mm
1 2
版本標(biāo)簽
單個(gè)文件
cvs tag REL_1_0_1 test.c
所有文件
cvs tag BASELINE_1
刪除標(biāo)簽
Cvs tag –d BASELINE_1
修改標(biāo)簽名
先貼上新標(biāo)簽
Cvs tag –r BASELINE_1 BASELINE_2
然后刪除舊標(biāo)簽名
Cvs tag –d BASELINE_1
標(biāo)簽的查看
Cvs status –v test.c
按日期貼標(biāo)簽
Cvs rtag –D 20011010 REL_1_0_1 test
如果要取回老版本并進(jìn)行修改,然后提交形成新版本的需求,有三種方法:
1、
Cvs update –p –D “2001-05-08” test.c > test.c
2,
首先取消所有附著性標(biāo)簽、版本號(hào)、日期等
Cvs update –A
在一個(gè)臨時(shí)目錄下導(dǎo)出代碼
Cvs export –D “2001-05-08” test
將所有代碼拷貝到原有目錄下覆蓋所有原有文件
Cp –r test /home/src/test
3、
cvs update -j 1.3 –j 1.2 test
版本分支
分支創(chuàng)建之后,分支標(biāo)簽是與分支樹的頭部版本關(guān)聯(lián)的,而不是與分支基點(diǎn)關(guān)聯(lián)的。如果需要載今后訪問分支基點(diǎn),需要在創(chuàng)建分支的時(shí)候,同時(shí)給主干代碼樹貼上一個(gè)便于識(shí)別的標(biāo)簽。
1、在工作拷貝中創(chuàng)建分支
Cvs co –r BASELINE_1 test
Cvs tag –b BASELINE_1_PATCH test
2、直接在倉(cāng)庫(kù)中創(chuàng)建分支
Cvs rtag –b –r BASELINE_1 BASELINE_1_PATCH