Git Extended icon

Git Extended

Run Git commands

Overview

The node "Git Extended" allows users to run various Git commands directly within an n8n workflow. It supports common Git operations such as initializing a repository, cloning, adding files, committing changes, pushing and pulling branches, checking status, viewing logs, switching branches, checking out commits or branches, and merging branches.

This node is beneficial in automation scenarios where version control actions need to be integrated into workflows, for example:

  • Automatically initializing a new Git repository when starting a project.
  • Cloning repositories as part of deployment pipelines.
  • Committing and pushing changes after automated file modifications.
  • Pulling updates from remote repositories before running build or test steps.
  • Managing branches programmatically during CI/CD processes.

Practical example: A workflow that clones a repository, modifies some files, commits the changes with a message, and pushes them back to the remote repository—all without manual intervention.

Properties

Name Meaning
Repository Path Filesystem path to run the Git command from. For clone, the repository will be created inside this path.

Since the operation is fixed to "Init" (Initialize repository) per user input, only the "Repository Path" property is relevant here.

Output

The output JSON contains two fields:

  • stdout: The standard output from the executed Git command, trimmed of whitespace. For init, this typically includes confirmation messages like "Initialized empty Git repository...".
  • stderr: The standard error output from the Git command, also trimmed. This may contain warnings or error messages if something goes wrong.

No binary data is output by this node.

Example output JSON snippet:

{
  "stdout": "Initialized empty Git repository in /path/to/repo/.git/",
  "stderr": ""
}

Dependencies

  • Requires Git to be installed and accessible on the system where n8n runs.
  • No external API keys or credentials are needed since it operates on local filesystem Git commands.
  • The node uses Node.js child process execution to run Git commands.

Troubleshooting

  • Common issues:

    • If the specified repository path does not exist or is inaccessible, the command will fail.
    • Lack of Git installation or incorrect PATH environment variable can cause command execution errors.
    • Permission issues on the filesystem may prevent repository initialization.
  • Error messages:

    • Errors from Git (e.g., "fatal: not a git repository") will appear in the stderr field.
    • If an unsupported operation is specified, the node throws an error indicating the operation is unsupported.
    • If the node fails and "Continue On Fail" is enabled, the error message will be included in the output JSON under error.
  • Resolutions:

    • Ensure the repository path exists and is writable.
    • Verify Git is installed and available in the system PATH.
    • Check permissions for the directory.
    • Use valid operation names supported by the node.

Links and References

Discussion