Repo
sfp repo clone
sfp repo cloneUSAGE
$ sfp repo clone [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url <value>] [-d
<value>] [--depth <value>] [-b <value>] [--default-branch] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
FLAGS
-b, --branch=<value> Clone a specific branch instead of the default branch.
-d, --directory=<value> Target directory for the cloned repository. Defaults to the repository name in the
current directory.
-e, --email=<value> Email address for authenticated user. Ignored if --application-token is provided. Can
be set via SFP_SERVER_USER env var.
-t, --application-token=<value> Application token for CI/CD authentication. Can be set via SFP_SERVER_TOKEN env var
(CLI flags take precedence over env vars).
--default-branch After cloning, switch to the default branch (e.g., main or master). Useful when
cloning a specific branch but wanting to end up on the default.
--depth=<value> Create a shallow clone with the specified number of commits. Use 0 for full history
(default). Useful for faster clones when full history is not needed.
--loglevel=<option> [default: info] logging level for this command invocation
<options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
--repository=<value> The repository identifier. E.g `owner/repo` for GitHub/GitLab or `org/project/repo`
for Azure DevOps
--sfp-server-url=<value> URL of the SFP server. Can be set via SFP_SERVER_URL env var or config: sfp
config:set server-url
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Clone a repository using authenticated credentials from the SFP server.
This command fetches an authenticated clone URL from the SFP server and clones the repository. The authentication
token is automatically embedded in the clone URL, making it suitable for CI/CD pipelines and automated workflows.
EXAMPLES
Clone a repository:
`sfp repo clone --repository owner/repo --application-token $SFP_SERVER_TOKEN --sfp-server-url http://localhost:3029`
Clone with shallow depth for faster cloning:
`sfp repo clone --repository owner/repo --depth 1 --application-token $SFP_SERVER_TOKEN`
Clone a specific branch:
`sfp repo clone --repository owner/repo --branch feature/my-branch --application-token $SFP_SERVER_TOKEN`
Clone to a specific directory:
`sfp repo clone --repository owner/repo --directory ./my-project --application-token $SFP_SERVER_TOKEN`
Clone and switch to default branch:
`sfp repo clone --repository owner/repo --branch release/v1.0 --default-branch --application-token $SFP_SERVER_TOKEN`sfp repo diff
sfp repo diffsfp repo list
sfp repo listsfp repo patch
sfp repo patchsfp repo visualize
sfp repo visualizesfp repo workspace-tree
sfp repo workspace-treeLast updated
Was this helpful?