Clearcase command guide is mainly used in Linux. 1. Basic operations
1.1. Help
CT help
1.2. Abbreviations
CT clearcase
CO check out
UNCO undo check out
CI check in
Mkview make View
Sview set view
Mkbrtype make branch type
Mklbtype make label type
1.3. Basic operations
// Check in/out files ('C' option for comment, 'nc 'for no comment)
CT co-nc xxx. cpp
CT ci-nc xxx. cpp
CT unco XXX. cpp
CT co-nc xxx. cpp yyy. cpp zzz. cpp
CT co-C 'some comments here 'xxx. cpp
// Adding files and directories to source control
CT mkdir directory-name
CT mkelem file-name
(When a file is added, it is retained in the check out State. Therefore, check in is required after the file is added)
// List all checkout files in the current directory
Ct lsco-r-s-cview.
// Create a branch
CT mkbrtype-C 'some comments here 'branch_name
// Create and tag
CT mklbtype-C 'some comments here 'label_name
CT mklabel-r label_name ***. cpp
// Remove a tag of the file CT rmlabel label_name ***. cpp
// Delete a tag
CT rmtype lbtype: label_name
// Search for all files in the directory labeled with label_name
CT find.-version "lbtype (label_name)"-print
// View version tree ('G' option for graphics)
CT lsvtree-g xxx. cpp
// GUI tool for clearcase in Linux/Unix
Xcleasecase
// Query all files of a branch
You need to first tap the CT command to enter the clearcase command line
Then: find.-All-branch brtype (my_branch_name)-print
Or directly: CT find.-All-version "brtype (my_branch_name)"-print
Print is printed. You can also add exec to execute other commands using the search results. For example, you can add a label to all branch files.
CT find.-All-version "brtype (my_branch_name)"-exec 'ct mklabel-r label_name $ clearcase_pn 'the command above must be a single double quotation mark.
// Merge
CT findmerge.-fversion/label_name-type D-merge // directory
CT findmerge.-fversion/lable_name-type F-merge // File
CT merge-to.-version (Version)
2. Script and tips
2.1 one-time check in all check out files in the current directory
Cleartool LSCO-r-s-cview. | xargs-I {} cleartool ci-C 'add some comments '{}
2.2. One-time undo check out cleartool LSCO-r-s-cview. | xargs-I {} cleartool unco-RM {}
2.3. Search for nodes containing a keyword
Foreach I (CT lsvtree-a-s.)
Foreach? CT ls $ I | grep keyword
Foreach? End