clearcase command (linux 常用命令)

时间:2022-07-06 22:40:02

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. BoneCP 升级遇到的问题

    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [c ...

  2. mysql中all privileges包含哪些权限

    mysql> grant all privileges on test.* to 'ybb'@'%' identified by 'ybb'; Query OK, 0 rows affected ...

  3. SOAP Services for Python

    转自:https://pypi.python.org/pypi/SOAPpy/ 1.下载SOAPpy 0.12.5 2.解压tar -xvzf SOAPpy-$VERSION$.tar.gz 3.安装 ...

  4. Cubieboard编译安装NodeJS经验总结

    Cubieboard编译安装NodeJS经验总结,以供新手免走弯路. Cubieboad用的是arm处理器,NodeJs的编译安装上不像pc上那么简单,可以一遍过. 单单make编译一次,就得几乎一个 ...

  5. linux主要目录的作用

    手动敲一遍.算是加强记忆吧~ /:文件系统的入口,也是最高一级的目录 /bin:最基本的且着急用户和普通用户都可以使用的命令放在此目录下,如:ls.cp等 /boot:存放Linux的内核及引导系统所 ...

  6. php阅读csv文件类

    php处理csv文件类: http://www.php100.com/cover/php/540.html <?php define("CSV_Start", 0); def ...

  7. 【Spark2&period;0源码学习】-4&period;Master启动

         Master作为Endpoint的具体实例,下面我们介绍一下Master启动以及OnStart指令后的相关工作   一.脚本概览      下面是一个举例: /opt/jdk1..0_79/ ...

  8. 新建github项目,邀请成员

    创建一个项目(repository) 进入项目,点击 SETTINGS 点击左侧导航的 Collaborators 在 Teams 里有个下拉菜单,里面你可以给你的 team 选择 write(写)权 ...

  9. java web添加mysql过程中遇到的错误及解决办法

    问题一:遇到提示找不到驱动   com.mysql.jdbc.Driver 起初项目中是导入了mysql-connector-java-5.1.45-bin.jar 包的,但是一直依然报错,最后去官网 ...

  10. Linux CAN Shell 测试脚本程序

    2012-01-13 22:57:14 为我的开发板2440做二次开发,添加了can驱动,做了驱动测试程序,没理由不添加一个测试脚本程序啊!修改了测试程序,使应用程序更加灵活,添加了一下传递参数.接着 ...