Git Extended icon

Git Extended

Run Git commands

Overview

The node "Git Extended" allows users to run various Git commands directly from n8n workflows. It supports a wide range of Git operations such as cloning repositories, committing changes, pushing and pulling branches, managing branches and tags, applying patches, and specifically for this request, pushing Git LFS (Large File Storage) objects.

The LFS Push operation pushes all Git LFS objects to a remote repository, optionally specifying the remote name and branch. This is useful in scenarios where large files tracked by Git LFS need to be uploaded separately from normal Git objects, ensuring that large assets are properly stored and synchronized with the remote.

Practical examples:

  • After committing large media files or datasets tracked by Git LFS, use the LFS Push operation to upload these files to the remote server.
  • Automate synchronization of large binary assets in CI/CD pipelines or content management workflows.

Properties

Name Meaning
Repository Path Filesystem path to run the Git command from. For clone, the repository will be created inside this path.
Remote Remote name to push LFS objects to. Default is "origin".
Branch Branch name to push LFS objects for.
Skip Stdout Whether to ignore command output to avoid maxBuffer errors. If true, command output is not captured.

Output

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

Example output JSON when not skipping stdout:

{
  "stdout": "<trimmed command output>",
  "stderr": "<trimmed error output>"
}

If the command fails and continueOnFail is enabled, the output will contain an error message:

{
  "error": "Error message describing what went wrong"
}

The node does not output any binary data.

Dependencies

  • Requires Git installed on the system where n8n runs.
  • Uses the Git LFS extension (git lfs) for handling large file storage operations.
  • The node may require an API key credential or username/password for authentication when accessing private repositories, but internal credential names are abstracted away.
  • No additional environment variables are strictly required for the LFS Push operation, but Git LFS must be configured correctly on the host.

Troubleshooting

  • Common issues:

    • Git or Git LFS not installed or not available in the system PATH.
    • Authentication failures when pushing to private remotes.
    • Incorrect repository path leading to "not a git repository" errors.
    • Large buffer overflow errors if command output is too large; can be mitigated by enabling Skip Stdout.
  • Common error messages:

    • "Command failed with exit code X": Indicates the Git command returned an error. Check the stderr output for details.
    • "Unsupported operation lfsPush": Means the operation name was incorrect or not implemented.
    • "Failed to parse the repository URL": Occurs if the repository URL is malformed or credentials are invalid.
  • Resolutions:

    • Ensure Git and Git LFS are installed and accessible.
    • Verify repository path correctness.
    • Provide valid authentication credentials if needed.
    • Enable Skip Stdout to avoid buffer size issues.
    • Review error messages in the node output for specific Git errors.

Links and References

Discussion