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, tag, or reference to clone. If empty, the remote's default branch is used. Errors if the specified reference does not exist.
Checkout
If true, checks out the specified reference after cloning.
Only Ref
If true, clones only the history leading to the specified reference, without fetching other branches or tags.
Depth
Creates a shallow clone with a history truncated to the specified number of commits. Use 0 for a full clone.
invalid port type: credentials
Credentials for accessing private repositories. If not provided, an anonymous clone is attempted.

Outputs#

Port Description
Success
Executes if the clone operation is successful.
Error
Executes if the clone operation fails.
invalid port type: git-repo Repository
A reference to the cloned local repository.

Addendum#

This node clones a Git repository into a specified local directory.

Authentication#

For private repositories, provide credentials to the auth input port. The following credential types are supported: - Username / Password - SSH Key (with optional password) - Access Token

If no credentials are provided, the node will attempt an anonymous clone, which will only work for public repositories.

Example#

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

ID: core/git-clone@v1