Actions26
Overview
The "Git Extended" node allows users to run a wide range of Git commands directly within an n8n workflow. It supports many common Git operations such as adding files, committing changes, cloning repositories, managing branches, pushing and pulling from remotes, applying patches, and more.
This node is beneficial in automation scenarios where you want to integrate Git version control actions into your workflows without manually running Git commands on the command line. For example:
- Automatically committing and pushing code changes after a build or test step.
- Cloning a repository to fetch the latest source before processing files.
- Creating or deleting branches programmatically based on workflow logic.
- Applying patches or rebasing branches as part of CI/CD pipelines.
The node executes Git commands by spawning shell processes, capturing their output, and returning results for further use in the workflow.
Properties
| Name | Meaning |
|---|---|
| Repository Path | Filesystem path where the Git command will be executed. For clone, the repo is created inside this path. |
| Files | Files or patterns to add (used with the Add operation). |
| Skip Stdout | Whether to ignore the command's standard output to avoid buffer overflow errors. |
Additional relevant properties for the Add operation (from bundled code context):
- Operation: The Git operation to perform; here fixed to "Add".
- Files: Specifies which files or file patterns to stage for commit.
- Skip Stdout: If true, suppresses command output to prevent maxBuffer errors.
Output
The node outputs an array with one item per input item. Each output item contains a json object with the following fields:
stdout: The trimmed standard output of the executed Git command (unlessskipStdoutis true).stderr: The trimmed standard error output of the command.- If
skipStdoutis true, thejsonobject will be empty{}since output is ignored. - In case of errors and if "Continue On Fail" is enabled, the output includes an
errorfield with the error message.
The node does not output binary data.
Dependencies
- Requires Git to be installed and accessible via the command line on the machine running n8n.
- Uses Node.js child process utilities to execute Git commands.
- Requires an API key credential for authentication when performing operations that need it (e.g., clone, push, pull), but the exact credential type is abstracted.
- No additional external services are required beyond Git and optional credentials for authentication.
Troubleshooting
Common issues:
- Command failures due to incorrect repository paths or missing Git installation.
- Authentication errors when accessing private repositories if credentials are not properly configured.
- Buffer overflow errors if command output is very large; can be mitigated by enabling "Skip Stdout".
- File pattern mismatches causing no files to be added.
Error messages:
"Unsupported operation <operation>": Occurs if an invalid operation name is provided."Command failed with exit code <code>": Indicates the Git command returned a non-zero exit status."Commit ID is required": For operations like cherry-pick or revert, a commit hash must be specified."Failed to parse the repository URL": Happens if the repository URL is malformed or credentials cannot be embedded.
Resolutions:
- Verify the repository path exists and is accessible.
- Ensure Git is installed and in the system PATH.
- Provide valid credentials for private repositories.
- Use "Skip Stdout" option if encountering maxBuffer exceeded errors.
- Double-check input parameters like file names, branch names, and commit IDs.