clearcase command (linux 常用命令)

 

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

 

 

你可能感兴趣的:(linux 常用命令)