clearcase命令指南

來源:互聯網
上載者:User
clearcase命令指南主要在linux下實踐1. 基本操作

1.1. 協助

ct help

1.2. 縮寫

ct clearcase

co check out

unco undo check out

ci check in

mkview make view

sview set view

mkbrtype make branch type

mklbtype make label type

1.3. 基本操作

//Check in/out files('c' option for comment ,'nc' for no comment)

ct co -nc xxx.cpp

ct ci -nc xxx.cpp

ct unco xxx.cpp

ct co -nc xxx.cpp yyy.cpp zzz.cpp

ct co -c 'some comments here' xxx.cpp

//Adding files and directories to source control

ct mkdir directory-name

ct mkelem file-name

(加入檔案的時候,它保留在check out狀態,所以在加入後,需要check in)

//列出目前的目錄下所有checkout的檔案

ct lsco -r -s -cview .

//建立分支

ct mkbrtype -c 'some comments here' branch_name

//建立標籤,打標籤

ct mklbtype -c 'some comments here' label_name

ct mklabel -r label_name ***. cpp
//去掉檔案的某一個標籤 ct rmlabel label_name ***.cpp

//刪除標籤

ct rmtype lbtype:label_name

//尋找目錄下所有打上label_name標籤的檔案

ct find . -version "lbtype(label_name)" -print

//看version tree('g' option for graphics)

ct lsvtree -g xxx.cpp

//GUI tool for clearcase in Linux/Unix

xcleasecase

//查詢某個分支的所有檔案

需要先敲ct命令進入clearcase命令列

然後:find . -all -branch brtype(my_branch_name) -print

或者直接:ct find . -all -version "brtype(my_branch_name)" -print

print 是列印出來,還可以加exec使用尋找結果來執行其它命令,比如可以將某一個branch的檔案都打上某個label
ct find . -all -version "brtype(my_branch_name)" -exec 'ct mklabel -r label_name $CLEARCASE_PN'上面的命令一定要主義單雙引號。

//merge

ct findmerge . -fversion /label_name -type d -merge //對目錄

ct findmerge . -fversion /lable_name -type f -merge //檔案

ct merge -to . -version (version)

2. 指令碼和小技巧

2.1. 一次性check in目前的目錄下所有check out的檔案

cleartool lsco -r -s -cview .|xargs -I {} cleartool ci -c 'add some comments' {}

2.2. 一次性undo check out目前的目錄下所有check out的檔案cleartool lsco -r -s -cview . |xargs -I {} cleartool unco -rm {}

2.3. 尋找含有某關鍵字的節點

foreach i ( ct lsvtree -a -s .  )

foreach? ct ls $i |grep keyword

foreach? end

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.