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 a wide range of Git operations such as cloning repositories, pushing and pulling branches, managing branches and tags, committing changes, applying patches, and more.

For the Push operation specifically, this node pushes commits from a local repository to a remote repository branch. It supports authentication methods (including custom username/password or API key-based), force pushing, and handling Git Large File Storage (LFS) objects.

Common scenarios:

  • Automating deployment workflows by pushing code changes to remote repositories.
  • Integrating Git version control into CI/CD pipelines.
  • Managing branches and commits programmatically.
  • Handling large files with Git LFS during push operations.

Practical example:
You have automated tests that generate new code or documentation updates. After successful tests, you want to push these changes to a remote Git repository branch automatically. This node can perform the push operation with optional force push and LFS support.


Properties

Name Meaning
Authentication Method to authenticate with the Git remote. Options: Authenticate (using an API key credential), Custom (username/password), None (no authentication).
Username Username for custom authentication (shown only if Authentication is Custom).
Password Password for custom authentication (shown only if Authentication is Custom).
Repository Path Filesystem path where the Git command will be executed.
Remote Name of the remote repository to push to (default: "origin").
Branch Branch name to push to on the remote repository.
Force Push Whether to force push (git push --force).
Push LFS Objects Whether to run git lfs push --all before pushing to upload all LFS objects.
Skip LFS Push Whether to set environment variable GIT_LFS_SKIP_PUSH=1 to avoid uploading LFS objects during push.
Skip Stdout Whether to ignore the command output to avoid maxBuffer errors (useful for very large outputs).

Output

The node outputs JSON data containing the standard output (stdout) and standard error (stderr) of the executed Git push command unless Skip Stdout is enabled, in which case the output JSON will be empty.

Example output JSON structure:

{
  "stdout": "<trimmed stdout text>",
  "stderr": "<trimmed stderr text>"
}

No binary data output is produced by this operation.


Dependencies

  • Requires Git installed and accessible in the system's PATH where n8n runs.
  • If using Git LFS features (Push LFS Objects or Skip LFS Push), Git LFS must be installed and configured.
  • For authenticated pushes, requires either:
    • An API key credential configured in n8n (referred generically as "an API key credential").
    • Or custom username and password credentials.
  • The node uses Node.js child process execution to run Git commands.

Troubleshooting

  • Authentication failures:
    Ensure correct credentials are provided. For custom authentication, verify username and password. For API key authentication, ensure the credential is valid and has necessary permissions.

  • Command fails with exit code:
    The node throws an error if the Git command exits with a non-zero status. Check the stderr output for details.

  • MaxBuffer errors:
    When pushing large repositories or many files, the command output might exceed buffer limits. Enable Skip Stdout to avoid this issue.

  • Git LFS issues:
    If pushing LFS objects fails, verify Git LFS is installed and properly configured. Use Push LFS Objects option to explicitly push all LFS objects before the main push.

  • Invalid repository path:
    Make sure the Repository Path points to a valid local Git repository.


Links and References

Discussion