CLONE

Description

Clones a remote repository.

Usage

cm clone <src_rep_spec> [<dst_rep_spec> | <dst_repserver_spec>] [--user=<usr_name> [--password=<pwd>] | [--authmode=<mode> --authdata=<data>] | [--authfile=<authentication_file>]] [--trmode=(copy|name|table --trtable=<translation_table_file>]

(Direct repository-to-repository clone.)

cm clone <src_rep_spec> --package=<pack_file> [--user=<usr_name> [--password=<pwd>] | [--authmode=<mode> --authdata=<data>] | [--authfile=<authentication_file>]] [--trmode=(copy|name|table --trtable=<translation_table_file>]

(Clones to an intermediate package, that can be imported later using a pull into the destination repository.)

Options

Option / ArgumentDescription
--user, --passwordCredentials to use if the authentication mode is different in source and destination and there is not a profile to authenticate to destination.
--packageExports the specified repository to a package file, instead of a repository. Useful for moving data between servers when there is no direct network connection. The resulting package must be imported using the pull command.
--authmodeDescribes the authentication method used in the server. Admisible values: NameWorkingMode, LDAPWorkingMode, ADWorkingMode, UPWorkingMode.
--authdataAuthentication information sent to the server. It holds the content of the <SecurityConfig> entry in the client.conf file and the profiles.conf file. The profiles.conf file can be easily generated from the Unity VCS in the connection profiles tab under Preferences.
--authfileAllows to specify a path to a file with the credentials.
--trmodeThe source and destination repositories may use different authentication modes. The '--trmode' option specifies how to translate the user names from the source to the destination. It must be one of the following values: copy: (Default.) Means that the user identifiers will be just copied; name: The user identifiers will be matched by name; table: Uses a translation table specified in the option '--trtable'
--trtableIf the translation mode is 'table', a translation table is a file containing lines in the form <oldname;newname> (one per line). When the branch is written to the destination repository, the objects created by a user identified by "oldname" in the source repository will be set to the user with "newname" on the destination.
src_rep_specSource repository of the clone operation. (Use 'cm help objectspec' to learn more about repository specs.)
dst_rep_specDestination repository of the clone operation. If it exists, it must be empty. If it does not exist, it will be created. If it is not specified, the command will use user's default repository server. (Use 'cm help objectspec' to learn more about repository specs.)
dst_repserver_specDestination repository server of the clone operation. If there is a repository with the same name as <src_rep_spec> in the destination repository server, it must be empty. If there is not, it will be created. If it is not specified, the command will use user's default repository server. (Use 'cm help objectspec' to learn more about repository server specs.)
translation_table_fileIf the translation mode is 'table', a translation table is a file containing lines in the form <oldname;newname> (one per line). When the branch is written to the destination repository, the objects created by a user identified by "oldname" in the source repository will be set to the user with "newname" on the destination.
authentication_fileAuthentication file where you may have a different file for each server you connect to, containing the credentials for that server. The file format must comply with the following structure: 2 lines, where the first line describes the authentication mode, equally described as in --auth_mode; and the second line containing the data as sdescribed in --auth_data.

Help

Remarks

The clone command can replicate branches (along with their changesets, labels, attributes, reviews, and so on) from a source repository to a destination repository. The repositories can be located at different servers.

The destination repository can be created beforehand, but if it contains previous data, the clone operation will fail.

The clone operation does NOT clone repository submodules, nor repositories under a Xlink.

Examples

cm clone awesomeProject@tardis@cloud

(Clones 'awesomeProject' repository from 'tardis@cloud' organization into a local repository with the same name.)

cm clone repo@server.home:9095 repo-local

(Clones 'repo' from 'server.home:9095' into 'repo-local' at user's default repository server.)

cm clone project@192.168.111.130:8084 repserver:192.168.111.200:9095

(Clones 'project' repository from '192.168.111.130:8084' into 'project@192.168.111.200:9095'.)

cm clone project@ldapserver:8084 --authmode=LDAPWorkingMode --authdata=::0:dave:fPBea2rPsQaagEW3pKNveA

(Clones 'project' repository from 'ldapserver:8084' using LDAP authentication against the remote repository.)

cm clone project@upserver:8084 --authmode=UPWorkingMode --authdata=dave:fPBea2rPsQaagEW3pKNveA==

(Clones 'project' repository from 'upserver:8084' using UPWorkingMode authentication against the remote repository.)

cm clone project@upserver:8084 --authmode=UPWorkingMode --user=<user> --password=<pwd>

(Clones 'project' repository from 'upserver:8084' using UPWorkingMode authentication against the remote repository but specifying the user and password instead of the authdata.)

cm clone project@ldapserver:8084 --authfile=credentials.txt --trmode=table --trtable=table.txt

(Clones 'project' repository from 'ldapserver:8084' using an authentication file against the remote repository, and translating users following the specified translation table.)

cm clone project@server.home:9095 --package=project.plasticpkg

cm repository create project@mordor.home:8084

cm pull --package=project.plasticpkg project@mordor.home:8084

(Clones 'project' repository from 'server.home:9095' into the package 'project.plasticpkg', which is later imported through a pull into the 'project' repository at 'mordor.home:8084'.)