Share (Command Line)

See Also

Makes the specified file or project a member of the current project.

Syntax

ss Share VSS files [-C] [-E] [-G] [-H] [-I-] [-N] [-O] [-P] [-R] [-V] [-W] [-Y] [-?]

Examples

Makes $/WORD/TEST.C a member of the current project:

ss Share $/WORD/TEST.C

Makes version 6 of TEST.C a member of the current project (note the command verb, Pin):

ss Pin TEST.C -V6

Creates a branch from the project $/WORD:

ss Share $/WORD -R -E

The following table describes the command-line options available with this command.

Option Description
-V Share an earlier version of a file (or project).
-G Set Get options for the retrieved local copy.
-W Make the retrieved local copy writable.
-R Share an entire project list recursively.
-P Specify a new name for the shared project.
-C Use the same comment for all shared projects (Available only when sharing projects.).
-O Paginate or redirect the command output.
-E Branch after sharing.
-I- Ignore: Do not ask for input under any circumstances.
-N Change between long and short file name mode.
-Y Specify a username and/or password.
-?, -H Request online Help on a command.

Access Rights

You must have the Check Out access right in the project you are sharing from, and the Add access right in the project you are sharing to, to use this command.

Remarks

To share a file, first set the current project path to the project that you want to share the file into with the CP command. Then execute the Share command, specifying the existing file(s) that you want to bring into your current project.

If you use the -E option, the file becomes a member of your current project, but it is branched: changes made in this project do not propagate to the originating project, and vice versa. The Links tab in the Properties dialog box on the File menu no longer shows a relationship, but you can use the Paths tab in the Properties dialog box to see the path of the file branch you have created.

Sharing an Explicit Version of a File or Project

To share an explicit version of a file, use the Pin command. With files, the -V option on Share is supported, but is not recommended. It specifies a file (that may or may not already be in the current project) and shares a specific version of it. When a project is sharing a specific version, it always uses that version no matter what changes are made in other projects. (If you are sharing a specific version, the ss Dir command displays this information.) The advantage of sharing a specific version of a file is that it allows you to control, in your project, the pace of changes being made by other users in other projects.

With projects, the -V option specifies an earlier project version to share. This creates a new project based on an existing one, but the new project is based on a specific version of the original project, rather than the current version. If you do not branch, the new project still shares all its files with the original, but it shares earlier versions of those files. If you branch, the new files are not shared with the old; it is as if you had rolled back all the files in the new project.

Sharing a Project

When you specify a project to share, instead of sharing a file from another project, you create an entirely new project under the current project that is an exact duplicate of the project you specified.

The -R option recursively shares a project and creates a new project list that shares all its files with the project list you specify.

If you use the -E option with a project, the new project does not share its files with the original project; all the files are branched.

The -P option specifies a new name for the newly created project. By default, the new project has the same name as the project you are sharing from. This default does not work, however, if you want the new project to be under the same parent as the old: Use the -P option to create a new branch with a new name. For example, if you share the project $/TESTDATA into your project $/GIZMO/TESTDATA without using the -P option, you create a situation where the subproject has the same name as the parent. With -P, you can avoid this as follows: SS SHARE -PSHARDATA $/TESTDATA