Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding files to sourcecontrol on linux using cleartool

I have a file that i want to add to sourcecontrol on linux using cleartool . I've followed the IBM documentation for this, i've tried this:

cleartool mkelem testScript.sh

I got an error: Can't modify directory "." because it is not checked out. I also would like to know how can i checkout/checkin files or directories and setting activities.

like image 482
Alex Brodov Avatar asked Aug 28 '14 14:08

Alex Brodov


People also ask

How do I add files or directories to source control?

You can add files or directories to source control at any time. To add view-private files and directories to source control, or to make placeholders for nonexistent files and directories: Go to the view used for your development task. The version-selection rules of your view determine the branch on which the first version of the element is created.

Does the path from which I add to source control need to?

For snapshot views, the path from which you add to source control does not need to be loaded. However, it must match the VOB namespace. Check out the parent directory element by entering cleartool checkout -nc directory-name.

How to add a directory to ClearCase control?

Checkout directory (.), copy file and add it to clearcase control. Then check-in directory. Directory needed updating to reflect change to its contents. Note that new files added to the directory can not be viewed by others until the directory is checked in. Example of adding all files to Clearcase control: ct mkelem -ci -nc *

Why do we use-NC option in cleartool?

Use the -nc option because appropriate comments are appended when you modify directory elements. After you add elements, check in the parent directory so that the elements are visible to others in the directory. cleartool checkin -nc . By default, when you add an element, it remains checked out.


1 Answers

You need to checkout the parent folder first.

cd /path/to/file/
cleartool mkact newfile
cleartool checkout -c "add file" .
cleartool mkelem testScript.sh
cleartool checkin -nc

The cleartool mkact would work if you are in an UCM view.
It will create and set a new activity, which will record the files and folder you will modify.

Here, the new activity newFile will record the new version of the parent folder, as well as the version 0 and 1 of the file.

like image 157
VonC Avatar answered Oct 16 '22 18:10

VonC