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当前目录下所有的文件和目录中的文件

    • Check out the latest version on the rel2_bugfix branch of file msg.c, to another file name.

      cmd-context checkout –nc –branch \main\rel2_bugfix –out msg_test.c msg.c 
      Checked out "msg.c" from version "\main\rel2_bugfix\1".
      cmd-context ls msg_test.c msg.c
      msg_test.c
      msg.c@@\main\rel2_bugfix\CHECKEDOUT from \main\rel2_bugfix\1
      [checked out but removed]

    • Check out the latest version on the rel2_bugfix branch of file msg.c, using an extended path name to indicate the branch. This command checks out the same version as the preceding example.

      cmd-context checkout –nc msg.c@@/main/rel2_bugfix          #after checkout, observation node point to the latest version of      rel2_bugfix,and checkout –nc msg.c@@/main/rel2_bugfix/0 has the same action, if non-zero after ".../rel2_bugfix/", checkout file will not be observed 
      Checked out "msg.c" from version "/main/rel2_bugfix/1".

    • Check out an old version of the file hello.h, using an extended path name to indicate the version. 

      cmd-context checkout –c "attempt fix of old bug" -version hello.h@@\main\1 
      Checked out "hello.h" from version "\main\1".

    • Perform an unreserved checkout of element hello.h. Provide a comment on the command line.

      cmd-context checkout –c "modify local defines"–unreserved hello.h 
      Checked out "hello.h" from version "/main/2"

    • Check out hello.c. Then, change your mind and cancel the checkout, removing the view-private copy.

      cmd-context checkout –nc hello.c 
      Checked out "hello.c" from version "\main\1". 
      cmd-context uncheckout –rm hello.c 
      Checkout cancelled for "hello.c".

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当前目录下所有的文件和目录中的文件

    • After verifying its checkout comment, check in element util.c, using that comment.

      cmd-context lscheckout –long util.c 
      10-May-99.16:11:07 Chuck Jackson (jackson.dvt@oxygen)
      checkout version "util.c" from /main/4 (reserved)
        by view: "oxygen/home/jackson/cj.vws"
        "revise syntax"

      cmd-context checkin –nc util.c
      Checked in "util.c" version "\main\5".

    • On a Windows system, check in an element from another file, discarding the checked-out version. Provide a comment on the command line.

      cmd-context checkin –rm –from c:\users\cep\util.c ^ 
      –c "Release 1.1 update" util.c 
      Checked in "util.c" version "\main\6".

    • (ClearCase) Check in only the configuration record of a derived object, discarding its data.

      cmd-context checkin –nc –cr hello 
      Checked in "hello" version "/main/1".

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.

      cmd-context lsvtree util.c 
      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.

      cmd-context lsvtree –all –obsolete util.c 
      ...
      util.c@@\main\4

    • List all versions on the rel2_bugfix branch of an element's version tree.

      cmd-context lsvtree -branch /main/rel2_bugfix -all util.c 
      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.

      cmd-context 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

    • On a UNIX or Linux system, create a branch type named bugfix. Then, set a view with a config spec that prefers versions on the bugfix branch, and create a branch of that type in file util.h.

      cmd-context mkbrtype –c "bugfixing branch" bugfix 
      Created branch type "bugfix".
      cmd-context setview smg_bugfix 
      cmd-context mkbranch –nc bugfix util.h 
      Created branch "bugfix" from "util.h" version "/main/1".
      Checked out "util.h" from version "/main/bugfix/0".

    • 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.

      cmd-context mkbrtype –c "bugfixing branch" bugfix 
      Created branch type "bugfix".
      > net use y: \\view\smg_bugfix 
      ...
      > y: 
      cmd-context mkbranch –nc bugfix util.h 
      Created branch "bugfix" from "util.h" version "\main\1".
      Checked out "util.h" from version "\main\bugfix\0".

    • Create a branch named rel2_bugfix off the version of hello.c in the view, and check out the initial version on the branch.

      cmd-context mkbranch –nc rel2_bugfix hello.c 
      Created branch "rel2_bugfix" from "hello.c" version "/main/4".
      Checked out "hello.c" from version "/main/rel2_bugfix/0".

    • Create a branch named maintenance off version \main\1 of file util.c. Do not check out the initial version on the branch.

      cmd-context mkbranch –version \main\1 –nco –nc maintenance util.c
      Created branch "maintenance" from "util.c" version "\main\1".

    • 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.

      cmd-context mkbranch –nc bugfix hello.c@@/main/3 
      Created branch "bugfix" from "hello.c" version "/main/3".
      Checked out "hello.c" from version "/main/bugfix/0".

    • 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.

      cmd-context mkbranch –nco –c "release 2 code patches" patch2 *.c 
      Created branch "patch2" from "cm_add.c" version "\main\1".
      Created branch "patch2" from "cm_fill.c" version "\main\3".
      Created branch "patch2" from "msg.c" version "\main\2".
      Created branch "patch2" from "util.c" version "\main\1".

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.

      cmd-context mkbrtype –c "bugfix development branch for V1" bugfix_v1
      Created branch type "bugfix_v1".

    • Create two branch types for working on program patches and a bug-fixing branch for release 2. Constrain their use to one per branch.

      cmd-context mkbrtype –nc –pbranch patch2 patch3 rel2_bugfix 
      Created branch type "patch2".
      Created branch type "patch3".
      Created branch type "rel2_bugfix".

    • 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.

      cmd-context mkbrtype -replace -pbranch \
      -c "change to one per branch" bugfix_v1 
      Replaced definition of branch type "bugfix_v1".

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

clearcase command (linux 常用命令)的更多相关文章

  1. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

  2. linux常用命令的介绍

    本文主要介绍Linux常用命令工具,比如用户创建,删除,文件管理,常见的网络命令等 如何创建账号: 1. 创建用户 useradd -m username -m 表示会在/home 路径下添加创建用户 ...

  3. linux 常用命令大全

    linux 常用命令大全 系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统 ...

  4. Linux常用命令整理 - imsoft.cnblogs

    su 用户名 在不退出登陆的情况下,切换到另外一个人的身份如果用户名缺省,则切换到root状态会提示输入密码,密码不回显的. 在用su命令切换root用户时,使用“-”选项,这样可以将root的环境变 ...

  5. 100个命令Linux常用命令大全

    Linux常用命令大全100条: 1,echo "aa" > test.txt 和 echo "bb" >> test.txt//>将原 ...

  6. Linux常用命令大全(非常全!!!)

    Linux常用命令大全(非常全!!!) 最近都在和Linux打交道,感觉还不错.我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短 ...

  7. 转载Alpine Linux常用命令

    Alpine Linux常用命令 目录 一:Alpine Linux开启SSH远程登陆 1.简介: 2.配置 3.配置命令 4.重启服务 二:Alpine Linux源管理 1.简介 2.国内源简介: ...

  8. 【转载】Linux常用命令

    Linux常用命令大全(非常全!!!) 转载出处:https://www.cnblogs.com/yjd_hycf_space/p/7730690.html 系统信息 arch 显示机器的处理器架构( ...

  9. Linux常用命令全称

    Linux常用命令全称 pwd:print work directory   打印当前目录 显示出当前工作目录的绝对路径 ps: process status(进程状态,任务管理器)    常用参数: ...

随机推荐

  1. python 中的queue 与多进程--待继续

    一.先说说Queue(队列对象) Queue是python中的标准库,可以直接import 引用,之前学习的时候有听过著名的“先吃先拉”与“后吃先吐”,其实就是这里说的队列,队列的构造的时候可以定义它 ...

  2. Socket_SSH-1

    服务器端: import socket,os server=socket.socket() server.bind(('localhost',9999)) server.listen() while ...

  3. 求熵 python 代码

    #coding=gbk import nltk import math def entropy(labels): freqdist = nltk.FreqDist(labels) #Frequency ...

  4. 什么是Docker?(6-12)

    关于什么是Docker,刚开始学的时候一脸懵X,这个东西到底是干嘛用的啊?偶然间在知乎上刷到一个比较通俗的解释: Docker就相当于一个容器,这个容器了不得了,它里面能搭好你项目需要的所有环境,并且 ...

  5. [洛谷P3793]由乃救爷爷

    题目大意:有$n(n\leqslant2\times10^7)$个数,$m(m\leqslant2\times10^7)$个询问,每次询问问区间$[l,r]$中的最大值.保证数据随机 题解:分块,处理 ...

  6. Linux相关——画图软件安装

    其实也不知道算不算Linux相关了... 装个画图软件还是很方便的,刚刚试了一下kolourpaint,感觉还行,就记录下来吧. 先记录几个快捷键emmmm print ---->全屏截图 al ...

  7. Educational Codeforces Round 6 A

    A. Professor GukiZ's Robot time limit per test 0.5 seconds memory limit per test 256 megabytes input ...

  8. 初学VS的目录结构

    工程目录下各文件的含义 一般大部分的文章可能介绍到上面就算结束了,但我这还没有.创建工程产生的各个文件都你知道是什么用的吗? 如果你是一个初学者,你可能会不知道(老手请跳过本文).Ok,我就带你逐一了 ...

  9. zjoi2018day2游记

    因为是在主场作战,所以就不需要东奔西跑了, 继一试爆炸以后,一个月来,感觉没有什么特别的进步,期间考了将近一个月的试, 每次如果拿应该拿的分的话,是不会太差的,但是从来没有发挥好过,就没有我认为正常过 ...

  10. NYOJ 745 dp

    蚂蚁的难题(二) 时间限制:1000 ms  |  内存限制:65535 KB 难度:3   描述 下雨了,下雨了,蚂蚁搬家了. 已知有n种食材需要搬走,这些食材从1到n依次排成了一个圈.小蚂蚁对每种 ...