ClearCase equivalent for git - checkout branch, commit and push code

118 Views Asked by At

In Git, for pushing our code to the new branch we do the following steps:

  1. Checkout the new branch
  2. Make changes in it
  3. Commit the code to the branch with commit message
  4. Push the code to the branch

What is the equivalent for it in ClearCase? It is so confusing!

Any help on this is appreciated!

1

There are 1 best solutions below

0
VonC On

In ClearCase, you would, for a regular view (dynamic in your case, from your last question):

  1. edit the config spec: cleartool edcs, in order to set the config spec to see all LATEST version of a given branch. The order of the rules is important, as ClearCase tries to apply the first one, then the second one.
element * /main/0 -mkbranch myBranch
element * .../myBranch/LATEST
element * /main/LATEST
  • The first rule will make sure any new element will be created on the branch you want, starting from the placeholder version /main/0.
  • The second rule will show you any existing file/directory with an existing version on that branch
  • The third rule will show you the latest version on the main branch (any element, file or folder, has at least one version on that default branch main).
  1. do a cleartool checkout of any file you need to modify (file after file: ClearCase operates at a file level, as opposed to Git which operates at the commit level, meaning at a full repository snapshot level).
    Then edit your file

  2. do a cleartool checkin of each file you have modify (or cleartool unco, for undo checkout, if you want to cancel a file modification, meaning you don't want to commit it).
    So each file would have its own commit message.

  3. the checkin itself does push automatically the change (of one single file) to ClearCase. Repeat for the other files.