Git Extended icon

Git Extended

Run Git commands

Overview

The "Git Extended" node allows users to run various Git commands directly within an n8n workflow. It supports common Git operations such as cloning repositories, adding files, committing changes, pushing and pulling branches, checking status, viewing logs, switching branches, and merging branches. This node is beneficial for automating version control tasks in CI/CD pipelines, synchronizing code repositories, or managing Git workflows without leaving the automation environment.

For example, you can use this node to:

  • Clone a repository into a specified directory.
  • Pull the latest changes from a remote branch.
  • Commit staged changes with a custom message.
  • Push local commits to a remote branch.
  • Check the current status of the repository.

Properties

Name Meaning
Repository Path Filesystem path where the Git command will be executed. For clone, the repository is created inside this path.
Remote Remote name to interact with (e.g., "origin"). Used in push and pull operations.
Branch Branch name to push to or pull from. Used in push and pull operations.

Output

The node outputs an array of items, each containing a json object with the following fields:

  • stdout: The standard output from the executed Git command, trimmed of whitespace.
  • stderr: The standard error output from the Git command, trimmed of whitespace.

This output provides the raw textual response from Git, which can be used for logging, debugging, or further processing in the workflow.

The node does not output binary data.

Dependencies

  • Requires Git to be installed and accessible on the system where n8n runs.
  • Executes Git commands via the system shell using child process execution.
  • No external API keys or services are required.

Troubleshooting

  • Common issues:

    • Incorrect repository path: Ensure the Repository Path points to a valid Git repository or a valid directory for cloning.
    • Missing branch or remote names when required: For push and pull operations, specifying the correct remote and branch is important.
    • Permission errors: The user running n8n must have appropriate filesystem permissions to access the repository path and execute Git commands.
    • Git not installed or not in PATH: The node relies on the git CLI being available.
  • Error messages:

    • "Unsupported operation <operation>": Indicates an invalid or unsupported Git operation was selected.
    • Git command errors (e.g., merge conflicts, authentication failures) will appear in the stderr output field.

To resolve errors:

  • Verify all input parameters are correct.
  • Check that Git is installed and accessible.
  • Review the stderr output for specific Git error messages.
  • Ensure proper permissions and network access for remote operations.

Links and References

Discussion