clearcase常用命令集锦
1.将整个目录导入clearcase
clearfsimport -r‘源路径’ ‘目标路径’
2.加锁
find . -name '*.*' -exec 'cleartool lock nuser userame1,username2 "%CLEARCASE_PN%"'
3.解锁
find . -name '*.*' -exec 'cleartool unlock "%CLEARCASE_PN%"'
4.转换格式
chtype -f compressed_file “fileName”
5.查看VOB的基本信息和UUID
des -l vob:.
6.删除视图
rmview -uuid "UUID"
7.删除lost+found
find . -name '*.*' -exec 'cleartool rmelem -f "%CLEARCASE_PN%"'
8.查询某一天的修改记录
cleartool lshis -r -since 07-dec
9.最基本的操作
cleartool co -nc filename
cleartool ci -nc filename
10.查看自己总共co了多少文件
cleartool lscheckout -cview –me -vobs
11.make目录和文件
cleartool mkdir -c comment newdirectory
cleartool mkelem -c comment newfilename
12.主线、分支文件合并
//查找需要合并的文件
cleartool findmerge . -fversion /main/TEST_Path -print
//比较文件不同
cleartool diff filename [url=mailto:file.cpp@@/main/xxxx_path/LATEST]filename@@/main/TEST_Path/LATEST
//查看最新版本
cleartool lsvtree filename
//合并
cleartool merge -to filename [url=mailto:file.cpp@@/main/xxxx_path/LATEST]filename @@/main/TEST_path/LATEST [url=mailto:file.cpp@@/main/LATEST]filename @@/main/LATEST
13.标签相关
cleartool mklbtype -nc TEST_LABEL
cleartool mklabel -r TEST_LABEL filename
cleartool rmtype lbtype:TEST_LABEL
//给所有打上TEST_LABEL标签的文件打上TEST_LABEL标签
cleartool mklabel -replace -version /main/TEST_LABEL TEST_LABEL *
//查找打上TEST_LABEL标签的所有文件
cleartool find . -version "lbtype(TEST_LABEL)" -print
//查找打上TEST_LABEL和TEST_LABEL1标签的文件
cleartool find . -element 'lbtype_sub(TEST_LABEL) && lbtype_sub(TEST_LABEL1)' -print
14.察看某目录下的文件
ls
15.man/help命令
cleartool man xxx
cleartool help xxx
16.放弃co某个文件
cleartool unco -keep filename
cleartool unco -rm filename
17.更改VOB的Owner:
cleartool protectvob –chown root /vob/vob.vbs
18. 更改VOB的Group:
cleartool protectvob –chgrp alluser /vob/vob.vbs
19.增加Additional Group:
cleartool protectvob –add_group group1 /vob/vob.vbs
20.删除Additional Group:
cleartool protectvob –delete_group group1 /vob/vob.vbs
21. 更改group、owner、mod
protect -r -chgrp groupname–chown username -chmod 770 .
22.创建VOB
cleartool mkvob -tag /vobtags/test_code -c "Test" "D:\Data\Tets.vbs"
23. Mount vob
Cleartool mount /vobtags/vob
24. 创建视图
cleartool mkview –tag test /ccvob/views/test.vws
25. 设置当前视图
cleartool setview test
26.设置当前的activity
cleartool setactivity activityname
27. Check out
Check out一个文件
Cleartool checkout [-reserve][-unreserve] filename
Check out前目录
Cleartool checkout .
Check out当前目录下所有文件
Cleartool Checkout –nc *.*
Check out当前目录下所有的文件和目录中的文件
cleartool find . $file -exec ‘cleartool checkout -nc $CLEARCASE_PN’
28. Check in
Check in 一个文件
Cleartool checkin filename
Check in 当前目录
Cleartool checkin .
Check in 当前目录下所有文件.
Cleartool Checkin –nc *.*
Check in当前目录下所有的文件和目录中的文件
cleartool find . $file -exec ‘cleartool checkin -nc –ide $CLEARCASE_PN’
以上内容来自:%CC%EC%B2%C5/blog/item/36bfbfc83cced1117f3e6fa0.html
常用命令:
创建view:clt mkview -tag view_abcd /view_store/view_abcd.vws
设置view: clt setview view_abcd
编辑config specification: clt edcs
创建branch type:clt mkbrtype dbg_branch1_comments
在某个文件的当前branch上, 拉出一个branch:
clt mkbranch dbg_branch1_comments filename.c
now you have make branch on the file, and checked it out.
you can edit it with gvim.
After changed codes, you can complie it successfully, and test the result, you can check it in.
clt ci filename.c
If you want to check out it again:
clt co filename.c
To change the branch name to a formula name you can use the command:
clt rename brtype:dbg_branch1_comments brtype:crnumber_branch1_comments
To see the version tree of a file:
clt lsvtree -g filename.c
To see which files is included in a branch, you can edit a script like this find_branch.sh:
echo "$1"
cleartool find -avobs -element "brtype("$1")" -nxn -print | xargs cleart
ool ls -s|grep "$1"
To compare files, I write a useful script file mydiff.
You can use xcc& to open graphic clearcase. So you can do most thing through the menu.
以上内容来自: