1

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!

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Harry
  • 3,072
  • 6
  • 43
  • 100
  • On the confusing part, read at least the first point of https://stackoverflow.com/a/1074785/6309: ClearCase operates file by file (which made sense when it was created in the 80', I mean last millennia 1984). It is not meant for current modern development workflow. – VonC Jan 07 '22 at 06:59

1 Answers1

0

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250