To add elements (files and directories) to source control from the command line
About this task
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:
Procedure
- 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. Make sure your view creates versions on an appropriate branch.
- Change to the parent directory under which you want
to add files and directories to source control.
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. Use the -nc option because appropriate comments are appended when you modify directory elements.
- Do one of the following:
- To add a directory to source control, enter this command:
cleartool mkdir directory-name
- To add a file to source control, enter this command:
cleartool mkelem file-name
- To make placeholders for nonexistent objects, enter one
of these commands:
cleartool mkdir directory-element-path
cleartool mkelem file-element-path
- To add a directory to source control, enter this command:
- After you add elements, check in the parent directory
so that the elements are visible to others in the directory.
cleartool checkin -nc .
Results
For more information about the mkelem command, see the mkelem reference page in the VersionVault Command Reference.