Clone Command

The Clone command clones a StarTeam view into a new Git repository.
Important: The Clone command is the first step in setting up a local Git repository for further Push and Pull commands with StarTeam.
Important: The Clone command will recreate the folders and files from StarTeam in the local Git repository using the default working directories from the StarTeam View.

Arguments

<starteam connection string>
Connection string format:
[starteam://]<hostname>:<port>/<project name>[/<view name>][/<folder name>]
<directory>
Git working directory.

Options:

--auto-cache-agent
Autolocate the Cache Agent to use while checking out the source code.
--bare (-b)
Clone to a bare repository.
--eol (cr|lf|crlf|off|platform)
Automatically convert the end-of-line markers while checking out files from StarTeam Server. The default is off, no end-of-line conversion is performed.
Note:
  • Regardless of the EOL setting in the file's properties in the StarTeam Cross-Platform Client (Fixed CR\LF\CRLF, Client defined), the -eol cr, lf, and crlf value will always override that setting.
  • When -eol platform option is used then pulled/fetched files will have the platform-specific EOL setting:
    • Microsoft Windows: CRLF.
    • Linux: - LF.
    • Mac: - CR.
--help (-h)
Command usage text.
--password (-p) <password>
StarTeam Password. If the password is not specified and has not been cached during previous commands then you will be prompted for a password.
--quiet (-q)
Progress is not reported.
--use-cache-agent <host:port>
Use Cache Agent <host:port> while checking out the source code.
--username (-u) <username>
StarTeam user that will perform this operation. If the StarTeam User name is not specified during the fetch/pull/push, then the user that was specified during the clone will automatically be used.
--verbose (-v)
Verbose mode.

Example 1: Cloning the Full View Hierarchy

This example shows you how to clone to a new Git repository where:

  • Project = SampleProject
  • View = SampleView
  • Server = 10.150.1.12
  • Port = 49201
  • Working Directory = C:\gitdemo\Sample
Important: Use a colon : as the delimiter during clone
Note: This example of specifying a full view hierarchy can also be used in the fetch, pull or push commands as well.
C:\gitdemo\Sample>git st clone "10.150.1.12:49201/SampleProject/SampleView:1.x Release:1.2 Release"

Example 2: Cloning from a Sub Folder

C:\gitdemo\Sample>git st clone "10.150.1.12:49201/SampleProject/SampleView/src/core/java”
Important: If View names within a StarTeam project are unique, then the Project Name/View Name format may be used in the command without the need to specify the full View hierarchy.