Actions26
Overview
The node "Git Extended" allows users to run various Git commands programmatically within n8n workflows. It supports a wide range of Git operations such as cloning repositories, committing changes, pushing and pulling branches, managing branches and tags, applying patches, and more.
For the Clone operation specifically, this node clones a remote Git repository into a specified local directory. It supports different authentication methods (including no authentication, custom username/password, or an API key credential) and options to control Git LFS behavior during cloning.
This node is beneficial in automation scenarios where you want to integrate Git version control actions into your workflows, for example:
- Automatically cloning a repository before running build or deployment steps.
- Syncing codebases by cloning repositories on-demand.
- Integrating with CI/CD pipelines that require fetching source code dynamically.
Properties
| Name | Meaning |
|---|---|
| Authentication | Method to authenticate with the Git repository. Options: "Authenticate" (using an API key credential), "Custom" (username and password), or "None". |
| Username | Username for custom authentication (used only if Authentication is "Custom"). |
| Password | Password for custom authentication (used only if Authentication is "Custom"). |
| Repository Path | Filesystem path from which to run the Git command. For clone, the new repository will be created inside this path. Defaults to current directory (.). |
| Repository URL | The URL of the Git repository to clone. This is required. |
| Target Path | Directory name/path to clone the repository into. Required. |
| Skip LFS Smudge | Boolean flag to set environment variable GIT_LFS_SKIP_SMUDGE=1 to skip downloading Git LFS objects during clone. Useful to speed up cloning when LFS objects are not needed immediately. Defaults to false. |
| Skip Stdout | Boolean flag to ignore the command output to avoid maxBuffer errors. Defaults to false. |
Output
The node outputs JSON data containing the standard output (stdout) and standard error (stderr) strings returned by the executed Git command.
- If Skip Stdout is enabled, the output JSON will be empty
{}because the command output is ignored to prevent buffer overflow issues. - Otherwise, the output JSON contains:
stdout: trimmed string of the command's standard output.stderr: trimmed string of the command's standard error output.
No binary data is produced by this operation.
Example output JSON when not skipping stdout:
{
"stdout": "Cloning into 'targetPath'...\n...",
"stderr": ""
}
Dependencies
- Requires Git to be installed and accessible in the system PATH where n8n runs.
- Supports optional authentication via:
- An API key credential configured in n8n (referred generically).
- Custom username and password.
- Uses Node.js child process execution to run Git commands.
- No additional external services are required beyond Git and optionally configured credentials.
Troubleshooting
Common Issues:
- Invalid or inaccessible repository URL: The node attempts to parse and use the URL; malformed URLs or inaccessible repositories will cause errors.
- Authentication failures: Incorrect credentials or missing authentication can cause clone failures.
- File system permissions: Insufficient permissions to write to the target path or repository path may cause errors.
- Buffer overflow errors: Large command output might cause maxBuffer errors unless "Skip Stdout" is enabled.
Error Messages:
Failed to parse the repository URL: Indicates the provided repository URL is invalid or cannot be parsed.Command failed with exit code X: Generic error indicating the Git command failed; check stderr for details.Unsupported operation clone: Should not occur if operation is correctly set to "clone".
Resolutions:
- Verify repository URL correctness and accessibility.
- Ensure correct authentication method and credentials are provided.
- Check file system permissions for the target directory.
- Enable "Skip Stdout" if encountering buffer size errors.