新增一個module於cvs維護
#cvs import -m "cvs demo test" test r0 start
//"":資訊, test:上傳至cvs顯示名稱, r0:一個廠商標籤, start:版本標籤
取出module
#cvs co sandra
建立檔案or目錄
#cvs add test
#cvs ci test
刪除檔案
#rm 檔案
#cvs remove 檔案
#cvs commit -m "remove file" 檔案
刪除目錄
#cd 目錄
#rm 目錄下所有檔案
#cvs remove 目錄下所有檔案 //ex: cvs remove a b c
#cvs commit -m "remove directory" 目錄下所有檔案 //ex:cvs commit a b c
#cvs update -P //-P會將空目錄由cvs資料庫中刪除
更改檔名
#mv 舊檔名 新檔名
#cvs remove 舊檔名
#cvs add 新檔名
#cvs commit -m "old name change to new name" 舊檔名 新檔名
更改目錄名
#mkdir 新名稱 //要改的新名稱
#cvs add 新名稱
#mv 舊的目錄/* 新的目錄 //將所有舊目錄下檔案移到新目錄
#cd 舊目錄;cvs remove 檔案 //在舊目錄下cvs remove 所有檔案
#cd 新目錄;cvs add 檔案 //在新目錄下cvs add 所有檔案
#cd..; cvs commit -m "old directory change to new directory" //回到上一層目錄commit
#cvs update -P //更新
cvs 指令快速查表 | |
cvs login | 登入cvs |
cvs import | 放個module進cvs管理 |
cvs checkout (co) | 拿出一個module |
cvs add | 增加檔案 |
cvs remove | 移除檔案 |
cvs commit (ci) | 確認改變,每次都要輸入改變的資訊log message(-m "message") |
cvs update (up) | 別人有新的送交行為時,更新自己的版本 |
cvs status (st) | 看目前repository裡面有那些檔,檔案版本等等資訊-l只看local |
cvs diff | 看兩個版本的差異 |
cvs log | 看一下log歷史紀錄 |
cvs logout | 登出cvs |
Q3. errors:(cvs client)
[sandra@ip234 cvstest]$ cvs import -m "cvs demo test" test r0 start
cvs import: No CVSROOT specified! Please use the `-d' option
cvs [import aborted]: or set the CVSROOT environment variable.
Ans:不能使用cvs -d :pserver:sandra@10.21.11.39:/home/cvsroot login,
再登入cvs時候請將先環境變數設定好,
#export CVSROOT=:pserver:sandra@10.21.11.39:/home/cvsroot
#cvs login