Clearcase version control: a quick start tutorial

May 15th, 2009 in Version Control. 7 comments
1 Star2 Stars3 Stars4 Stars5 Stars (18 votes, average: 4.50 out of 5)
Loading ... Loading ...

So you have joined a new development team and they happen to use Clearcase for version control. You have used other version control systems earlier but need to get up and running quickly in Clearcase without reading a mountain of documentation. Fear not as you have come to the right place. This little tutorial here will not attempt to make you a Clearcase guru but provide just enough information to get started.

Concepts

  • VOB or Versioned Object Base: This is the permanent data repository of a development tree or subtree storing all file system elements. It is typically hosted on in the network on a remote host and mounted as an MVFS file system on the user’s machine.
  • View: A view is what you use to access a VOB transparently. Without a view, the VOB appears to be empty.
  • Elements,Branches,and Versions: A versioned file system object in a VOB is called an element. There can be multiple versions of each element logically organized into a hierarchical version tree containing multiple branches/sub-branches.
  • Config Spec: A config spec is a document that contains a set of rules that is used by the view for selecting the versions of elements. A simplified explanation would be that a config spec is a filter that determines what versions of elements from the vob gets loaded into a view. Typically the Clearcase admin or project lead will provide you with a config spec and it looks somewhat like this:
  • ########################################
    # config spec:
    # line1 - Select any files I have checked out
    # line 2 - Ignore lost+found.
    # line 3 - Select the LATEST element on the main branch
    ########################################
    element       *      CHECKEDOUT
    element      …/lost+found/…      -none
    element      *     /main/LATEST

    Of course, a real config spec is much larger and more complicated.

Usage

  • So to get started, get your vob tag from your clearcase admin and activate your vob. Note: You may not need to perform this step as this process may have already been completed when your clearcase client installation was completed. Also note that you will need cleartool (ct) in your path.

    ct mount vob_tag

  • Then create a view (say my_view) specifying where you want your view storage location.

    ct mkview -tag my_view /path/to/location/the_view.vws

  • Now set the config spec.

    ct setcs your_config_spec

  • You are now ready to check out your file.

    ct co -c ‘add your comment here’ <filename>

  • After you have modified the file, you can check it in using the following command:

    ct ci -nc <filename>

    Use the -nc option if you do not want to add any comments.

Other common commands:

  • Undo checkout:

    ct unco <filename>

  • Check out a file but dont reserve it

    ct co -unres <filename>

  • List all files checked out:

    ct lsco -all -cview

  • Diff a file with its previous version

    ct diff -pred <filename>

  • See the history of a file

    ct lshist <filename>

  • Tags: ,

7 Responses to “Clearcase version control: a quick start tutorial”

  1. Abe at
    says:

    nice quick concise ..much appreciated stuck with this prop sw

  2. Mikle Chivozertsev at
    says:

    It is really helpful for quick start

  3. shiv at
    says:

    Nice work!!!

  4. Noushad The champ at
    says:

    It was an awesome starter for clear case.
    Thanku..

  5. amar at
    says:

    great tutorial…thnk u :):)

  6. Pramod at
    says:

    BookMarked!!!

  7. jahir at
    says:

    good articles

Leave a Reply

Sponsors