IBM ClearCase常用命令 - joyocaowei/joyocaowei.github.io GitHub Wiki

以下命令全部基于ClearCase version 7.1.2.1(目前使用的版本)

IBM官方文档地址, 其中的Reference里面有所有的cleartool子命令

打开文件$HOME/.cshrc(或者.bashrc), 增加一行alias ct /usr/atria/bin/cleartool, 之后可以使用ct替代cleartool

创建一个view并与stream关联

ct mkview -tag viewname -stream streamname@/vobs/xxxx_pvobxx -stgloc -auto

viewname最好是你的id名加上streamname, 比如123456_streamname

ct lsview List all views

ct setview viewname

利用上面的命令查找你自己的某个view, 然后此命令用于set这个view
it allows you to view the Clearcase archive from /vobs/xxxx/..

最基本的操作

-nc means "No Comment"

ct co -nc xxx 检出文件xxx
ct ci -nc xxx 检入文件xxx
ct lsco -r

List all checked out files recursively looks in current directory and sub directories.

新增目录和文件

注意新增文件和目录,先要 check out 父目录,添加成功后,再将父目录 check in

ct co -nc . check out 当前的目录
ct mkelem -ci -nc newfile Add file to Clearcase control
ct rm file 删除文件file
ct ci -nc . check in 当前的目录

ct mkdir new_dir 新增一个目录
cleartool protect -chmod 755 file/folder 更改文件或者目录的权限

放弃co某个文件

ct unco file 保留当前所改动的文件(UN-Check-Out file. Cancel a checkout of a file)
ct unco -rm file 删除当前所改动的文件

比较文件不同

ct diff -pred filename

修改完代码后,想跟以前版本比较,看看有哪些改动(Clearcase diff between current file and predecessor)

ct lsvtree file 查看版本历史(List all branches of specified file)

ct diff file file@@/main/streamname/xx

比较当前分支最新版本和指定分支最新版本的区别(基于lsvtree查找出来的历史版本)

查询某一天的修改记录

ct lshis -r -since 27-nov

比较两个baseline之间,有哪些文件改动

ct diffbl -versions [baseline1] [baseline2]

For example, ct diffbl -versions baseline1@/vobs/nbos_pvobxx baseline2@/vobs/nbos_pvobxx

一些查询命令

cleartool lsbl -s 查询baseline
cleartool lsstream -cview
cleartool lsbl -long -component <component-selector@UCM Project Vob> –cview
cleartool lsvob

Last but not the least

请使用帮助命令(ct help clearcase-command)和帮助文档

Reference

http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html