Skip to content

Git Clone

Clones a Git repository from a URL into a local directory.

Inputs#

Port Description
URL
The URL of the Git repository to clone (e.g., https, ssh).
Directory
The local directory path where the repository will be cloned.
Reference
The specific branch to clone. If empty, the remote's default branch is used.
Checkout
Whether to checkout the specified reference after cloning. Defaults to true.
Only Ref
If true, only the specified reference will be cloned (no other branches or tags).
Depth
Creates a shallow clone with a history truncated to the specified number of commits. A value of 0 or less means a full clone.
invalid port type: credentials
Optional credentials for accessing private repositories. If not provided, the node will use the default Git configuration.

Outputs#

Port Description
Success
Executes if the clone operation is successful.
Error
Executes if the clone operation fails.
invalid port type: git-repo Repository
The cloned Git repository object.

Addendum#

This node uses the go-git library to perform a clone operation.

Authentication#

For private repositories, ensure that the necessary credentials are configured in your environment's Git configuration or provide them through a secrets management system.

Example#

To clone the main branch of the Actionforge repository into a my-project directory: - URL: https://github.com/actionforge/actionforge.git - Directory: ./my-project - Branch: main

ID: git-clone@v1