
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.
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 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
Properties
url *Requiredstring
Repository URL
HTTP(S) or SSH URI used for clone and push operations.
branch string
Branch to checkout
Used only when no commit or tag is specified.
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)
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.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
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.
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