Actions26
Overview
This node, named "Git Extended," allows users to run various Git commands directly within an n8n workflow. It supports a wide range of Git operations such as initializing a repository, cloning, adding files, committing changes, pushing and pulling branches, managing branches and tags, applying patches, and more.
The node is beneficial in automation scenarios where Git version control actions need to be integrated into workflows without manual intervention. For example, it can automate repository initialization, commit code changes from automated processes, or synchronize repositories by pulling and pushing updates.
Practical examples:
- Automatically initialize a new Git repository in a specified directory.
- Commit and push changes made by other nodes or scripts in the workflow.
- Clone a remote repository to a local path for further processing.
- Manage branches programmatically, such as creating or deleting branches based on workflow logic.
Properties
| Name | Meaning |
|---|---|
| Repository Path | Filesystem path to run the Git command from. For clone, the repository will be created inside this path. |
| Skip Stdout | Whether to ignore command output to avoid maxBuffer errors (true/false). |
Output
The node outputs an array with one item per input item processed. Each output item contains a json object with the following fields:
stdout: The trimmed standard output string from the executed Git command (unlessSkip Stdoutis true).stderr: The trimmed standard error string from the executed Git command (unlessSkip Stdoutis true).
If Skip Stdout is enabled, the output JSON will be empty ({}) to avoid buffer overflow issues.
If an error occurs during execution and the node is configured to continue on failure, the output JSON will contain an error field 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.
- For some operations involving authentication (clone, push, pull), requires an API key credential or custom username/password credentials configured in n8n.
- No additional external services are required beyond Git and optional authentication credentials.
Troubleshooting
Common Issues:
- Incorrect or inaccessible
Repository Pathmay cause command failures. - Missing or invalid credentials when performing authenticated operations like clone, push, or pull.
- Buffer overflow errors if command output is very large; enable
Skip Stdoutto mitigate. - Invalid Git commands due to unsupported or misspelled operation names.
- Incorrect or inaccessible
Error Messages:
"Unsupported operation <operation>": The selected operation is not implemented by the node."Command failed with exit code <code>": The Git command returned a non-zero exit status, indicating failure. Check thestderroutput for details."Commit ID is required": For operations like cherry-pick, revert, or reset, a commit hash must be provided."Failed to parse the repository URL": Authentication credentials could not be applied to the repository URL; verify URL format and credentials.
Resolutions:
- Verify all input parameters, especially paths and commit IDs.
- Ensure Git is installed and accessible.
- Use
Skip Stdoutoption if encountering maxBuffer errors. - Provide valid credentials for authenticated operations.