Actions26
Overview
The node "Git Extended" allows running various Git commands directly from n8n workflows. It supports a wide range of Git operations such as cloning repositories, committing changes, managing branches, pulling and pushing updates, applying patches, and more.
The Apply Patch operation specifically enables applying a patch to a Git repository. The patch can be provided either as raw text or as a file path. This is useful for automating code updates, bug fixes, or feature additions distributed as patch files in CI/CD pipelines or integration workflows.
Practical examples:
- Automatically apply a patch received from an external system to a local Git repository.
- Use patch text generated dynamically in a workflow to update source code.
- Apply binary patches when working with non-textual changes.
Properties
| Name | Meaning |
|---|---|
| Repository Path | Filesystem path where the Git command will be executed. For clone, the repo is created inside this path. |
| Patch Input | Choose how to provide the patch: as raw text ("Text") or as a file path ("File"). |
| Patch Text | The patch content as plain text (used if Patch Input is "Text"). |
| Patch File Path | Filesystem path to the patch file (used if Patch Input is "File"). |
| Binary | Whether to apply the patch in binary mode (true/false). |
| Skip Stdout | Whether to ignore the command output to avoid maxBuffer errors (true/false). |
Output
The node outputs JSON data containing the standard output (stdout) and standard error (stderr) from the executed Git command, unless Skip Stdout is enabled, in which case the output JSON is empty.
Output JSON structure example when not skipping stdout:
{
"stdout": "<trimmed command output>",
"stderr": "<trimmed error output>"
}
If Skip Stdout is true, the output JSON will be {}.
No binary data output is produced by this operation.
Dependencies
- Requires Git to be installed and accessible on the system where n8n runs.
- Uses Node.js child process execution to run Git commands.
- No external API keys or services are required specifically for the Apply Patch operation.
- The node requires an API key credential for authentication in some operations, but Apply Patch does not require authentication.
Troubleshooting
Common issues:
- Incorrect repository path: Ensure the
Repository Pathpoints to a valid Git repository. - Invalid patch format: The patch text or file must be a valid Git patch.
- Permission errors: The n8n process must have read/write permissions on the repository and patch file paths.
- Large patch files may cause buffer overflow errors; use
Skip Stdoutto mitigate.
- Incorrect repository path: Ensure the
Error messages:
Unsupported operation applyPatch: Indicates the operation name was not recognized (unlikely here).Command failed with exit code X: The Git apply command failed; check patch validity and repository state.- File not found errors if the patch file path is incorrect.
Resolutions:
- Verify all input paths and patch contents.
- Enable
Skip Stdoutif encountering maxBuffer errors. - Check Git repository status manually to ensure it is clean and ready for patch application.