🚀 New! Kestra raises $3 million to grow Learn more

Clone Clone

yaml
type: "io.kestra.plugin.git.Clone"

Clone a repository.

Examples

Clone a public GitHub repository.

yaml
id: "clone"
type: "io.kestra.plugin.git.Clone"
url: https://github.com/dbt-labs/jaffle_shop
branch: main

Clone a private repository from an HTTP server such as a private GitHub repository using a personal access token.

yaml
id: "clone"
type: "io.kestra.plugin.git.Clone"
url: https://github.com/kestra-io/examples
branch: main
username: git_username
password: your_personal_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.

yaml
id: "clone"
type: "io.kestra.plugin.git.Clone"
url: git@github.com:kestra-io/kestra.git
directory: kestra
privateKey: <keyfile_content>
passphrase: <passphrase>

Clone a GitHub repository and run a Python ETL script. Note that the Worker task is required so that the Python script shares the same local file system with files cloned from GitHub in the previous task.

yaml
id: gitPython
namespace: prod

tasks:
  - id: fileSystem
    type: io.kestra.core.tasks.flows.WorkingDirectory
    tasks:
      - id: cloneRepository
        type: io.kestra.plugin.git.Clone
        url: https://github.com/kestra-io/examples
        branch: main
      - id: pythonETL
        type: io.kestra.plugin.scripts.python.Commands
        beforeCommands:
          - pip install requests pandas > /dev/null
        commands:
          - python examples/scripts/etl_script.py

Properties

url

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

The URI to clone from.

branch

  • Type: string
  • Dynamic: ✔️
  • Required:

The initial Git branch.

cloneSubmodules

  • Type: boolean
  • Dynamic:
  • Required:

Whether to clone submodules.

depth

  • Type: integer
  • Dynamic:
  • Required:
  • Default: 1
  • Minimum: >= 1

Creates a shallow clone with a history truncated to the specified number of commits.

directory

  • Type: string
  • Dynamic: ✔️
  • Required:

The optional directory associated with the clone operation. If the directory isn't set, the current directory will be used.

passphrase

  • Type: string
  • Dynamic: ✔️
  • Required:

The passphrase for the privateKey.

password

  • Type: string
  • Dynamic: ✔️
  • Required:

The password or personal access token.

privateKey

  • Type: string
  • Dynamic: ✔️
  • Required:

PEM-format private key content that is paired with a public key registered on Git. To generate an ECDSA PEM format key from OpenSSH, use the following command: ssh-keygen -t ecdsa -b 256 -m PEM. You can then set this property with your private key content and put your public key on Git.

username

  • Type: string
  • Dynamic: ✔️
  • Required:

The username or organization.

Outputs

directory

  • Type: string
  • Dynamic:
  • Required:

The path where the repository is cloned.