> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# clone

> Clones a remote repository to the local working directory. This operation supports sparse folder checkout and shallow clone using depth input. Inputs

Clones a remote repository to the local working directory. This operation supports sparse folder checkout and shallow clone using depth input.

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Instance Code</td><td>`FDGIT_INP_INSTANCE_CODE`</td><td>Yes</td><td>The FlexDeploy SCM instance for Git repository where source code is stored.</td></tr><tr><td>Destination Subfolder</td><td>`FDGIT_INP_DEST_SUBFOLDER`</td><td>No</td><td>Directory within FD\_TEMP\_DIR to clone into. If no subfolder is provided the Git repository will be cloned directly into the temp directory.</td></tr><tr><td>Branch</td><td>`FDGIT_INP_BRANCH`</td><td>No</td><td>Specifies the Git Branch to clone from. Defaults to master.</td></tr><tr><td>Depth</td><td>`FDGIT_INP_DEPTH`</td><td>No</td><td>Allows a depth to be specified. Set to 1 to only grab the latest commit (to simulate an export in SVN).</td></tr><tr><td>Sparse Checkout Folders</td><td>`FDGIT_INP_SPARSE_CHECKOUT_FOLDERS`</td><td>No</td><td>Specify comma separated folders to checkout. This is useful when you do not want to clone entire repository.</td></tr><tr><td>Treeless Clone</td><td>`FDGIT_INP_TREELESS_CLONE`</td><td>No</td><td>Treeless clone (--filter=tree:0) is helpful for automated builds where cloned repository is discarded after build.Don’t use this option if you intend to view history or push changes.May lead to smaller and faster cloning depending on your git provider.</td></tr></tbody></table>

# Artifacts

This operation doesn't consume or produce any artifacts.  

# Endpoint Selection

This operation delegates endpoint selection to the workflow developer. The workflow editor will default the selection to "All", which selects all available endpoints associated to the target.

Selecting a specific resource will result in selection of endpoints associated to the target which have that resource defined.

# Endpoint Execution

This operation will execute on any one of the selected endpoints and will be random in the determination of which one.

# Special Considerations

If the remote repository has a considerable history, this too will be cloned unless the `FDGIT_INP_DEPTH` is set to 1. This will only grab the latest version of the code, which is useful for building where there will **not** be a commit back into the remote repository.
