Git Extended icon

Git Extended

Run Git commands

Overview

The node "Git Extended" allows running various Git commands directly from n8n workflows. It supports a wide range of Git operations such as fetching, cloning, committing, pushing, pulling, branching, tagging, and more. This node is useful for automating Git repository management tasks within integration workflows, enabling continuous deployment pipelines, automated code updates, or repository maintenance without manual intervention.

For the Fetch operation specifically, the node executes a git fetch command to update local references from a remote repository. This is beneficial when you want to synchronize your local repository with changes from a remote source without merging them immediately. For example, it can be used in CI/CD pipelines to ensure the latest remote branches are available before running builds or tests.

Properties

Name Meaning
Repository Path Filesystem path where the Git command will be executed. For fetch, this is the local repo path.
Remote The name of the remote repository to fetch from (e.g., "origin").
Branch The specific branch to fetch from the remote. If empty, fetches all branches.
Skip LFS Smudge Whether to set the environment variable GIT_LFS_SKIP_SMUDGE=1 to skip downloading Git LFS objects during fetch.
Skip Stdout Whether to ignore the command output to avoid maxBuffer errors. If true, output is not returned.

Output

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

  • stdout: The trimmed standard output of the executed Git fetch command, containing any informational messages.
  • stderr: The trimmed standard error output, containing warnings or errors from the Git command.

If the Skip Stdout property is enabled, the output JSON will be empty ({}) because the command output is ignored to prevent buffer overflow issues.

No binary data 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.
  • Supports optional authentication via API key credential or custom username/password for operations that require it (not applicable for fetch unless private repos).
  • No additional external services are required for the fetch operation itself.

Troubleshooting

  • Common Issues:

    • Incorrect Repository Path: If the path does not point to a valid Git repository, the fetch command will fail.
    • Authentication failures if fetching from private remotes without proper credentials.
    • Buffer overflow errors if the command output is very large; can be mitigated by enabling Skip Stdout.
    • Git LFS related errors if LFS objects are expected but skipped incorrectly.
  • Error Messages:

    • "Unsupported operation Fetch": Indicates the operation name was not recognized; ensure "Fetch" is selected.
    • Git errors like "fatal: not a git repository" indicate invalid repository path.
    • Authentication errors if credentials are missing or incorrect.
  • Resolutions:

    • Verify the repository path points to a valid Git repo.
    • Provide correct credentials if accessing private repositories.
    • Enable Skip Stdout to avoid maxBuffer errors on large outputs.
    • Use Skip LFS Smudge if LFS objects cause delays or errors during fetch.

Links and References

Discussion