Use the sync command to synchronize changes on your local hard disk (working folders or workspace) to your view and vice versa. For instance, if you deleted a file or a folder on disk, sync deletes that file or folder from the view. If you have a new file or not-in-view folder (with files) on your local hard disk, sync adds them to the view. sync does not synchronize views with each other.
sync supports the same syntax as the ci command (check in) for process items and reasons for checking in files. If the project requires a reason for adding/checking in files, specify one with -d or -r. If the project requires a process item, specify one with -cr, -req or -task. You cannot use -p with sync. It is one of the new class of stateful commands.
The syntax for this command is:
stcmd{Ex} sync workspace|view|both [-o] [-nivf][-q] [-cmp]
[-l | -u | -nel] [-vl "labelName"]
[-nomove] [-d|-r "comment" | -rf "fileName"]
[[-active | [-cr | -req | -task] processItemPath] [-mark]]
The full syntax is:
stcmd -p "userName:password@hostName:endpoint/projectName/[viewName/][folderHierarchy/]"
For example:
stcmd -p “bsmith:rocketfive@orion:49201/StarDraw/StarDraw/SourceCode/”
The -epwdfile keyword specifies the path to the file that contains the encrypted password. Like -pwdfile , -epwdfile replaces the password being used as part of the -p or -s option, preventing others from seeing the user's password on the command line. The full syntax is: -epwdfile "filePath" .
The -pwdfile is supported for backward compatibility. Un-encrypted passwords stored using older versions of stcmd are read. However, passwords cannot be stored to files using -pwdfile anymore.
In this case, the syntax of -p or -s reduces to -p "username@hostname:port/... -epwdfile "fullyQualifiedPathToPasswordFile"".
The following is the syntax of the commands that can be used to store an encrypted password.
Use the following syntax to be prompted for the password that will be encrypted and stored in a file.
stcmd store-password -epwdfile "filePath"
stcmd store-password -epwdfile "filePath" -password "password"
After an encrypted password is stored, other stcmd commands can specify -epwdfile "filePath"' as parameters. For example:
stcmd delete-local -p "JMarsh@Orion:1024/StarDraw/StarDraw/SourceCode" -epwdfile "C:\estuff\myfile.txt" -filter "N" "*"
Compresses all the data sent between the workstation and the server and decompresses it when it arrives. Without this option, no compression takes place.
Compression speeds transmission across the network, but it takes time on the front end to compress the data and at the back end to decompress the data.
This is an optional parameter. If not specified, then the platform default is not to compress.
When the command maps the folder specified in the -p option to the underlying StarTeam folder, using -csf causes the command to differentiate StarTeam folders based on the case-sensitive spelling of their names This option does not apply to the case-sensitivity of filenames in the folders. For example, with -csf, StarTeam folders named doc and Doc are recognized as different folders. Without this option, either folder could be recognized as the doc folder.
The default is that StarTeam folders are not differentiated based on the case of letters in their names.
With or without -csf, if folder names are ambiguous, an error occurs. For example, when you use -csf, the names of two folders are ambiguous if both a Doc and doc folder exist. When you do not use -csf, folder names are ambiguous if they are spelled identically.
Encrypts all data sent between the workstation and the server and decrypts it when it arrives. Without this option, no encryption takes place. Encryption protects files, data and other project information from being read by unauthorized parties over unsecured networks.
This is an optional parameter. If not specified, then the server and the command line negotiate the encryption required by the server.
The full syntax is: -encrypt encryptionType.
The types of encryption are:
These encryption types are ordered from fastest to slowest. Each of the slower encryption types is safer than the one preceding it.
Complete path from the project view's root folder to the change request, requirement, or task number to be used as a process item. Use the forward slash (/) as a delimiter between folder names.
For out-of-view process items, specify the project name and view name in front of the complete folder path. For example:
-cr MyProject/RootView/RootFolder/SourceCode/37
This specifies change request 37 in the SourceCode folder (under the root folder) of the ChildView view in the MyProject project.
If a process item is specified, then the files being checked in are attached to the process item and follow the project process rules.
-cr, -req or -task are mutually exclusive. If any one of them is specified, -filter/-f are ignored.
The following is a simple sync example:
stcmd connect "User:PW@server:port"
stcmd set project=projectname view=viewname
stcmd sync {view | workspace | both} -nivf
When you specify view, sync applies to the view all the changes you have made to your workspace (that is, working folders on disk). When you specify workspace, sync applies to your workspace all the changes made to your view. When you specify both, it does both of the above.