
Git Clone
CertifiedClone a Git repository
Git Clone
Clone a Git repository
Clones a repository over HTTP(S) or SSH, optionally checking out a branch, tag, or commit. Defaults to a shallow clone (depth 1) unless a tag or commit is requested; set cloneSubmodules to fetch submodules. Supports repository caching to avoid full re-clones across executions.
type: io.kestra.plugin.git.CloneExamples
Clone a public GitHub repository.
id: git_clone
namespace: company.team
tasks:
- id: wdir
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/blueprints
branch: main
Clone a repository with caching enabled to avoid full re-clones across executions.
id: git_clone_cached
namespace: company.team
tasks:
- id: clone
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/blueprints
branch: main
cache: true
cacheTtl: PT24H
Clone a private repository from an HTTP server such as a private GitHub repository using a personal access token.
id: git_clone
namespace: company.team
tasks:
- id: wdir
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/blueprints
branch: main
username: git_username
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
Clone a repository from an SSH server. If you want to clone the repository into a specific directory, you can configure the directory property as shown below.
id: git_clone
namespace: company.team
tasks:
- id: wdir
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone
type: io.kestra.plugin.git.Clone
url: git@github.com:kestra-io/kestra.git
directory: kestra
privateKey: "{{ secret('SSH_PRIVATE_KEY') }}"
passphrase: "{{ secret('SSH_PASSPHRASE') }}"
Clone a GitHub repository and run a Python ETL script. Note that the WorkingDirectory task is required so that the Python script shares the same local file system with files cloned from GitHub in the previous task.
id: git_python
namespace: company.team
tasks:
- id: file_system
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: clone_repository
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/examples
branch: main
- id: python_etl
type: io.kestra.plugin.scripts.python.Commands
dependencies:
- requests
- pandas
commands:
- python examples/scripts/etl_script.py
Clone then checkout a specific commit (detached HEAD).
id: git_clone_commit
namespace: company.team
tasks:
- id: clone_at_sha
type: io.kestra.plugin.git.Clone
url: https://github.com/kestra-io/kestra
commit: 98189392a2a4ea0b1a951cd9dbbfe72f0193d77b
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-git --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.
Properties
url *string
Repository URL
HTTP(S) or SSH URI used for clone and push operations.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150auth
Kestra API authentication
branch string
Branch to checkout
Used only when no commit or tag is specified.
cache booleanstring
falseEnable repository caching
When true, caches the .git directory in Kestra internal storage and restores it on subsequent runs, fetching only new commits instead of performing a full clone. Note that only metadata and objects inside .git are cached; working tree files outside .git are not persisted in the cache. Healing corrupted or degraded object caches during incremental fetches is best-effort. Defaults to false.
cacheTtl string
Cache TTL (Time To Live)
After this duration, the repository cache will be invalidated. Defaults to no expiration.
cloneAllBranches booleanstring
trueClone all branches
When true, clones all remote branches. When false, follows single-branch clone behavior.
cloneSubmodules booleanstring
Clone submodules
Default false; enable to fetch and initialize nested submodules.
commit string
Commit SHA to checkout
Detached HEAD checkout; short SHA allowed. Overrides branch and disables shallow clone.
connectTimeout integerstring
10000HTTP connect timeout (ms)
Default 10000 ms.
depth integerstring
1Shallow clone depth
Defaults to 1. Ignored when commit or tag is set to ensure history is available.
directory string
Target directory
Subdirectory under the working directory where the repo is cloned; defaults to the working directory root.
gitConfig object
Git configuration overrides
Map of git config keys and values applied after clone, e.g.:
- core.fileMode: false (ignore permission flips)
- core.autocrlf: false (preserve line endings)
kestraUrl string
Kestra API URL
URL of the Kestra server API.
If not set, the URL of the default SDK authentication is used, set with the kestra.tasks.sdk.authentication.url configuration property, or at the namespace or the tenant level on the Enterprise Edition.
It then falls back to the kestra.url configuration property, and finally to http://localhost: 8080.
knownHosts string
Known hosts file content used for SSH host key verification
OpenSSH known_hosts-formatted content used to verify the remote server's SSH host key. If not set, the system/user known_hosts file is used. Only relevant when strictHostKeyChecking is true.
noProxy booleanstring
Disable proxy for HTTP
When true, forces direct connections instead of using the JVM proxy settings.
noTags booleanstring
falseDo not fetch tags
When true, skip fetching tags during clone and fetch fallback.
passphrase string
Passphrase for privateKey
password string
Password or personal access token
Supplies HTTP credentials. When a PAT is used, pushes are recorded under that PAT’s user without needing authorName and authorEmail.
**GitHub PAT permissions required: **
- Fine-grained PAT:
Contents: Read(clone/fetch) orContents: Read and Write(push), plusMetadata: Read(mandatory base permission). AddWorkflows: Read and Writewhen pushing.github/workflows/files. - Classic PAT:
reposcope covers all read/write operations; addworkflowwhen pushing workflow files.
privateKey string
PEM private key
PEM-formatted private key matching a public key registered on the Git server. Generate with ssh-keygen -t ecdsa -b 256 -m PEM.
readTimeout integerstring
60000HTTP read timeout (ms)
Default 60000 ms.
strictHostKeyChecking booleanstring
Whether to verify the SSH remote server's host key
When enabled, the host key presented by the Git server is verified against knownHosts (if provided) or the system/user known_hosts file. Disabling it exposes the connection to man-in-the-middle attacks (CWE-297). Set knownHosts alongside this property for a hardened setup. The default differs by edition: disabled (false) on Kestra OSS, enabled (true) on Kestra Enterprise Edition.
tag string
Tag to checkout
Ignored when commit is set; performs a full fetch to reach the tag.
trustedCaPemPath string
Extra trusted CA PEM path
Optional PEM-encoded CA bundle added to the JVM truststore; equivalent to git config http.sslCAInfo <path> for self-signed or internal CAs.
username string
Username or organization
Used for HTTP basic authentication and as a fallback commit author.
Outputs
directory string
Path where the repository is cloned