Git Extended icon

Git Extended

Run Git commands

Overview

The "Git Extended" node allows users to run various Git commands directly within n8n workflows. It supports a wide range of Git operations such as cloning repositories, committing changes, managing branches, pushing and pulling from remotes, applying patches, and more.

Specifically, the Rename Branch operation renames an existing branch in a local Git repository. This is useful when you want to change the name of a branch without deleting and recreating it, preserving its history and references.

Common scenarios:

  • Renaming a feature or bugfix branch to better reflect its purpose.
  • Correcting typos in branch names.
  • Standardizing branch naming conventions across a team.

Example usage:

  • You have a branch named feature/login and want to rename it to feature/authentication.
  • The node runs the equivalent of git branch -m feature/login feature/authentication inside the specified repository path.

Properties

Name Meaning
Repository Path Filesystem path where the Git command will be executed. For clone, the repo is created here.
Current Name The current name of the branch you want to rename.
New Name The new name for the branch after renaming.
Skip Stdout Whether to ignore the command output to avoid maxBuffer errors (true/false).

Output

The node outputs JSON data with the following structure:

  • If Skip Stdout is false (default), the output contains:

    • stdout: The trimmed standard output from the Git command.
    • stderr: The trimmed standard error output from the Git command.
  • If Skip Stdout is true, the output JSON will be empty {} since command output is ignored.

No binary data is produced by this operation.

Example output when not skipping stdout:

{
  "stdout": "",
  "stderr": ""
}

(Note: git branch -m typically produces no output on success.)

Dependencies

  • Requires Git to be installed and accessible via the command line on the machine running n8n.
  • The node executes Git commands using the system shell.
  • No external API keys or services are required for the Rename Branch operation.
  • The user must provide a valid filesystem path to a Git repository (Repository Path).

Troubleshooting

  • Common issues:

    • Invalid repository path: The specified path does not contain a Git repository.
    • Branch does not exist: The Current Name branch is not found in the repository.
    • Permission issues: Insufficient permissions to modify the repository or execute Git commands.
    • Naming conflicts: The New Name branch already exists.
  • Error messages:

    • Command failed with exit code X: Indicates the Git command failed; check that branch names are correct and repository path is valid.
    • Unsupported operation renameBranch: Should not occur if operation is correctly set.
    • File system errors when deleting temporary files (rare for this operation).
  • Resolutions:

    • Verify the repository path points to a valid Git repository.
    • Confirm the current branch name exists.
    • Ensure the new branch name does not conflict with existing branches.
    • Check file system permissions for the user running n8n.

Links and References

Discussion