Git Extended icon

Git Extended

Run Git commands

Overview

This node, named "Git Extended," allows users to run a wide range of Git commands directly within an n8n workflow. It supports many common Git operations such as cloning repositories, committing changes, pushing and pulling branches, managing branches, applying patches, tagging commits, and more.

The node is useful for automating Git workflows without leaving the n8n environment. For example, it can be used to:

  • Automatically tag a commit after a successful deployment.
  • Clone a repository and check out a specific branch before running tests.
  • Commit and push changes made by other nodes in the workflow.
  • Manage branches programmatically (create, delete, rename).
  • Apply patches or revert commits as part of a CI/CD pipeline.

Specifically, the Tag operation creates a Git tag on a specified commit (or HEAD by default), which is helpful for marking release points or important milestones in your repository history.

Properties

Name Meaning
Repository Path Filesystem path where the Git command will be executed. For clone, the repo is created here.
Tag Name Name of the tag to create.
Commit ID Commit hash to tag. Defaults to HEAD if not provided.
Skip Stdout Whether to ignore the command output to avoid maxBuffer errors.

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 that case, the output JSON will be empty.

For the Tag operation, the output typically confirms the creation of the tag or returns any error messages from Git.

Example output JSON when not skipping stdout:

{
  "stdout": "tag v1.0.0",
  "stderr": ""
}

If Skip Stdout is true, the output JSON will be:

{}

No binary data output is produced by this node.

Dependencies

  • Requires Git to be installed and accessible in the system's PATH where n8n runs.
  • Uses Node.js child process execution to run Git commands.
  • Requires an API key credential for authentication when cloning, pushing, or pulling from private repositories.
  • Optionally supports custom username/password authentication for Git operations.
  • No additional external services are required beyond Git and optional credentials.

Troubleshooting

  • Common issues:

    • Git not installed or not in PATH: The node will fail to execute commands.
    • Incorrect repository path: Commands will fail if the path does not exist or is not a Git repository.
    • Authentication failures: When accessing private repos, ensure correct API key or credentials are configured.
    • Buffer overflow errors: Large command outputs may cause maxBuffer errors; enable Skip Stdout to avoid this.
    • Invalid tag names or commit IDs: Git will return errors if the tag name is invalid or the commit does not exist.
  • Error messages:

    • "Unsupported operation <operation>": The selected operation is not implemented.
    • "Command failed with exit code <code>": The Git command returned an error; check the stderr output for details.
    • "Failed to parse the repository URL": The repository URL is malformed or credentials could not be injected properly.
    • "Commit ID is required": Some operations require a commit hash; ensure this is provided.

To resolve errors, verify input parameters, repository accessibility, and authentication settings.

Links and References

Discussion