http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearcase.hlp.doc/cc_main/c_hood_cleartool_cli.htm
开发人员常用命令 : vob
1. 建立vob
mkvob –tag /vobtags/vob1 –c “ VOB for project1” /vobstore/vob1.vbs
2. Mount vob
Cleartool mount /vobtags/vob1
3. 创建视图
cleartool mkview –tag test1 /ccvob/views/test1.vws
4. 设置当前视图
cleartool setview test1
5. 在VOB的根目录下到入数据:
clearfsimport –recurse –c “ comments “ /home/setup/* . ,注意命令的最后为圆点,表示当前目录。
6. 改变VOB的Owner:
cleartool protectvob –chown root /vobstore/vob1.vbs
7. 改变VOB的Group:
cleartool protectvob –chgrp alluser /vobstore/vob1.vbs
8. 增加Additional Group:
cleartool protectvob –add_group group1 /vobstore/vob1.vbs
9. 删除Additional Group:
cleartool protectvob –delete_group group1 /vobstore/vob1.vbs 修改vob中数据的权限信息
10. 将jmccboss VOB 中所有元素Owner 改成ccadmin,Group改成jmccboss:
Cleartool protect –chown ccadmin –chgrp jmccboss . '.'为vob根目录
11. 将jmccboss VOB 中所有元素权限 改成对ccadmin(rwx),jmccboss(rwx),其他VOB附属组成员(r-x):
Cleartool protect –recurse –chmod 775 .
12. 建立一个snapshot view
cleartool mkview –tag pat_2_snapshot_view –snapshot /viewstore/pat/myviews.vws
13. 更新snapshot view
cleartool update pat_2_snapshot_view
14. 查看VOB的基本信息和UUID
des -l vob:.
15. 删除视图
rmview -uuid "UUID"
16. 查看brtype
lstype -kind brtype/othertype -short/long # short:只显示type名字,long:显示详细信息,kind后面跟你想要查看的type类型
开发人员常用命令 : version control
1. Check out
cleartool co -nc xxx.cpp
Cleartool checkout [-reserve][-unreserve] b.c Check out一个文件
Cleartool checkout . Check out当前目录
Cleartool Checkout –nc *.* Check out当前目录下所有文件
cleartool find . $file -exec ‘cleartool checkout -nc $CLEARCASE_PN’
Check out当前目录下所有的文件和目录中的文件
2. Check in
cleartool ci -nc xxx.cpp
Cleartool checkin b.c Check in 一个文件
Cleartool checkin . Check in 当前目录
Cleartool Checkin –nc *.* Check in 当前目录下所有文件.
cleartool find . $file -exec ‘cleartool checkin -nc –ide $CLEARCASE_PN’
Check in当前目录下所有的文件和目录中的文件
- util.c, using that comment.
-
On a Windows system, check in an element from another file, discarding the checked-out version. Provide a comment on the command line.
-
(ClearCase) Check in only the configuration record of a derived object, discarding its data.
3. 编辑config spe
Cleartool edcs
4. 查看自己总共co了多少文件
cleartool lscheckout -cview -me -avobs
5. 最有用的命令
cleartool man xxx
cleartool help xxx
5.新增目录和文件
cleartool mkdir -c comment new_dir
cleartool mkelem -c comment new_file.cpp
6.放弃co某个文件
cleartool unco -keep file.cpp //保留当前所改动的文件
cleartool unco -rm file.cpp
7.主线、分支文件合并
//查找需要合并的文件
cleartool findmerge . -fversion /main/xxxx_path -print
//比较文件不同
cleartool diff file.cpp file.cpp@@/main/xxxx_path/LATEST
//查看最新版本
cleartool lsvtree file.cpp
- List selected versions from an element's version tree.
util.c@@/main
util.c@@/main/3 (REL3)
util.c@@/main/4
-
List all versions and all obsolete branches in an element's version tree.
...
util.c@@\main\4
-
List all versions on the rel2_bugfix branch of an element's version tree.
util.c@@/main/rel2_bugfix
util.c@@/main/rel2_bugfix/0
util.c@@/main/rel2_bugfix/1
-
Start a version tree browser to display all versions in an element's version tree.
lsvtree –graphical –all util.h
//合并
cleartool merge -to file.cpp file.cpp@@/main/xxxx_path/LATEST file.cpp@@/main/LATEST
cleartool merge -nc -to filename -version src_branch
将src_branch merge到当前的checkout节点, 如果不是checkout,命令将报错而执行不成功。
src_branch can be as /main/../LATEST or label
8.标签相关
//新建标签
cleartool mklbtype -nc TEST_LABEL
//给文件打标签
cleartool mklabel -r TEST_LABEL file.cpp
//删除标签
cleartool rmtype lbtype:TEST_LABEL
//给所有打上TEST_LABEL标签的文件打上TEST_LABEL2标签
cleartool mklabel -replace -version /main/TEST_LABEL TEST_LABEL2 *
//查找打上TEST_LABEL标签的所有文件
cleartool find . -version "lbtype(TEST_LABEL)" -print
//查找打上TEST_LABEL和TEST_LABEL2标签的文件
cleartool find . -element 'lbtype_sub(TEST_LABEL) && lbtype_sub(TEST_LABEL2)' -print
9. 加锁
find . -name '*.*' -exec 'cleartool lock nuser userame1,username2 "%CLEARCASE_PN%"'
10.解锁
find . -name '*.*' -exec 'cleartool unlock "%CLEARCASE_PN%"'
11. 转换格式
chtype -f compressed_file “fileName”
12. 删除lost+found
find . -name '*.*' -exec 'cleartool rmelem -f "%CLEARCASE_PN%"'
13. 查询某一天的修改记录
cleartool lshis -r -since 07-dec
14. see the version tree of a file:
cleartool lsvtree -g filename.c
15. 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 cleartool ls -s|grep "$1"
16. 查找分支上的文件
find . -branch brtype(branchname) -print
cleartool find -all -version “lbtype(REL1)” -print
find . -version 'lbtype(LABEL)' -print
17. make branch
- util.h.
-
On a Windows system, create a branch type named bugfix. Then, set a view drive with a config spec that prefers versions on the bugfix branch, and create a branch of that type in file util.h.
-
Create a branch named rel2_bugfix off the version of hello.c in the view, and check out the initial version on the branch.
-
Create a branch named maintenance off version \main\1 of file util.c. Do not check out the initial version on the branch.
-
Create a branch named bugfix off version /main/3 of file hello.c, and check out the initial version on the branch. Use a version-extended pathname to specify the version.
-
For each file with a .c extension, create a branch named patch2 at the currently selected version, but do not check out the initial version on the new branch. Provide a comment on the command line.
18. make brtype
- Create a branch type named bugfix_v1, which can be used only once in an element's version tree. Provide a comment on the command line.
-
Create two branch types for working on program patches and a bug-fixing branch for release 2. Constrain their use to one per branch.
-
Change the constraint on an existing branch type so that it can be used only once per branch. Provide a comment on the command line.
19. 锁分支命令
lock brtype:branchname
20, 创建trigger
trigger已存在
mktrtype mktrtype -replace -element -all -preop mkelem -nusers shiquan -exec \\192.168.1.5\cc_trigger\false.bat NO_RM_MK
trigger不存在
mktrtype mktrtype -element -all -preop mkelem -nusers shiquan -exec \\192.168.1.5\cc_trigger\false.bat NO_RM_MK