Actions26
Overview
The "Git Extended" node allows users to run a variety of Git commands directly within an n8n workflow. It supports many common Git operations such as cloning repositories, committing changes, managing branches, cherry-picking commits, reverting commits, resetting to specific commits, 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, it can be used to automate deployment pipelines, synchronize code repositories, or manage feature branches programmatically.
Specifically, the Cherry Pick operation applies a commit from one branch onto the current branch by specifying the commit hash. This is useful when you want to selectively apply changes from other branches without merging entire branches.
Example use case for Cherry Pick:
- You have a hotfix commit on a development branch that you want to apply to the main branch without merging all development changes.
- You specify the commit ID of the hotfix and the node runs
git cherry-pick <commit>to apply it.
Properties
| Name | Meaning |
|---|---|
| Repository Path | Filesystem path to run the Git command from. For clone, the repository will be created inside this path. |
| Commit ID | Commit hash to cherry-pick (required for Cherry Pick, Revert, Reset operations). |
| Skip Stdout | Whether to ignore command output to avoid maxBuffer errors (boolean). |
Output
The node outputs JSON data containing the standard output (stdout) and standard error (stderr) strings resulting from the executed Git command, unless Skip Stdout is enabled. When Skip Stdout is true, the output JSON will be empty.
Output example when not skipping stdout:
{
"stdout": "<trimmed command output>",
"stderr": "<trimmed error output>"
}
If an error occurs during execution and the node is set to continue on failure, the output will contain an error field with the error message.
The node does not output binary data.
Dependencies
- Requires Git to be installed and accessible in the system environment where n8n runs.
- Uses Node.js child process utilities to execute Git commands.
- Requires an API key credential for authentication if operations like clone, push, or pull are performed with authentication.
- No additional external services are required.
Troubleshooting
- Missing Commit ID: The Cherry Pick operation requires a valid commit hash. If omitted, the node throws an error "Commit ID is required".
- Command Execution Errors: If the Git command fails (e.g., due to invalid repo path, conflicts during cherry-pick), the node throws an error with the exit code and message.
- MaxBuffer Errors: Large command outputs may cause buffer overflow errors. Enable
Skip Stdoutto avoid capturing output and prevent these errors. - Authentication Failures: For operations requiring authentication, ensure correct API key or credentials are configured.
- File System Permissions: Ensure the specified repository path is accessible and writable by the n8n process.