n8n Git nodeConfigure Git in n8n.
The n8n Git node drives a git repository that your n8n instance can reach on disk. It carries 15 operations, from clone and commit through to log, tag and switch branch, and every one of them starts from a Repository Path. Built for teams whose workflows write files worth versioning.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n Git node actually do?
The Git node is a core node shipped with n8n, and it wraps the git command line around a repository stored at a path the n8n instance can read and write. You pick one operation per node, point it at a Repository Path, and n8n performs the same action a developer would type in a terminal. Nothing is installed, and it costs nothing beyond n8n itself, on n8n Cloud as well as on a self-hosted instance.
Start with the scenario most teams land on first: a workflow produces files, and those files need a history. A nightly export lands in a folder, Add stages the paths, Commit writes the change with a message, Push sends it to the remote. Three nodes, and every export becomes a diff someone can read a month later.
The second scenario reads instead of writes. Log returns the commit history of a repository or of a single file, Status reports what changed since the last commit, and Reflog shows where a reference has pointed over time. Feed that output into If to branch on whether anything moved, or reshape it with Edit Fields (Set) before it reaches a report.
The third one is about preparing a working copy. Clone pulls a repository into a fresh local path, Switch Branch moves to the branch a job should work on, and Add Config plus User Setup settle the identity commits are written under. That sequence turns an empty folder into a repository a later workflow can commit to.
Now the honest limit. This node talks to git, not to GitHub, GitLab or any hosting product. Opening a pull request, commenting on an issue or reading a repository through a web API is out of scope, and that is where HTTP Request or a dedicated node takes over. The node also needs the repository to exist on a filesystem the n8n instance can reach, which in practice means a self-hosted instance with a mounted volume.
Two more things worth knowing before you build. The node runs once per incoming item, so a list of ten file paths arriving from a previous step means ten git actions unless you collapse them first. And it does not start a workflow on its own: a Schedule Trigger, a Webhook or another tool's trigger has to come first. If you are still choosing your automation platform, the n8n review covers that decision in depth.
What do you need to authenticate?
- 01
Choose an authentication mode
Clone and Push both show an Authentication selector with two values,
gitPassword(Authenticate) andnone(None). Pick None when the repository is public or when the remote is a local path, and pick Authenticate when the remote demands an account. The other operations work on the local repository and never ask the question. - 02
Create the Git credential
With Authenticate selected, the node asks for a Credential for Git. Create it once from the Credentials menu in n8n, where it is stored under your account and reused by every workflow that needs it. The credential uses basic auth and holds two fields, a Username and a Password for GitHub, GitLab or a similar platform.
- 03
Point the node at a repository
Every operation asks for a Repository Path, the local path of the git repository on the machine running n8n. Clone is the exception in shape: it takes a New Repository Path for the destination folder and a Source Repository for the URL or path being copied. A path can come from a previous step as an expression, written
{{ $json.path }}.
Which Git operation should you pick?
The Git node exposes 15 operations. For each one: the node as you configure it in n8n, the required fields, and our field notes.
Operations index
- Add a file or folder to commit
- Add configuration property
- Clone a repository
- Commit files or folders to git
- Fetch from remote repository
- Return current configuration
- Return git commit history
- Pull from remote repository
- Push to remote repository
- Push tags to remote repository
- Return reference log
- Return status of current repository
- Switch to a different branch
- Create a new tag
- Set up a user
Add a file or folder to commit
addWhat you see in n8n
Notes & use cases
Staging comes before committing, and this operation is the staging step. It marks files or folders so that a later Commit includes them in the snapshot.
Key parameters
- Paths to Add: a required comma separated list of paths, absolute or relative to the Repository Path, shown with the placeholder
README.md. - Repository Path: the local path of the git repository the staging applies to.
Add configuration property
addConfigWhat you see in n8n
Notes & use cases
Git keeps settings as key and value pairs, and this operation writes one of them into the local config of the repository.
Key parameters
- Key: the required name of the key to set, with
user.emailas the placeholder. - Value: the required value to store, placeholder
name@example.com. - Mode: an option with two choices,
setto overwrite the setting andappendto add to it rather than replace it.
Clone a repository
cloneWhat you see in n8n
Notes & use cases
Where most operations expect a repository to already sit on disk, this one creates it by copying a remote into a local folder.
Key parameters
- New Repository Path: the required local path the repository gets cloned into, placeholder
/tmp/repository. - Source Repository: the required URL or path of the repository being copied, placeholder
https://github.com/n8n-io/n8n. - Authentication: Authenticate to pass a credential in, None to clone without one.
Commit files or folders to git
commitWhat you see in n8n
Notes & use cases
This is the operation that turns staged changes into a permanent entry in the history, with a message attached to it.
Key parameters
- Message: the commit message, not required by the node, though a history without messages is hard to read later.
- Branch: an option naming the branch to switch to before committing, placeholder
main; left empty, the commit lands on the current branch. - Paths to Add: an option listing paths to commit, placeholder
/data/file1.json; unset, every added file and folder goes in.
Fetch from remote repository
fetchWhat you see in n8n
Notes & use cases
Fetching downloads what the remote knows without touching the files in your working copy, which makes it the safe way to look before you merge.
Return current configuration
listConfigWhat you see in n8n
Notes & use cases
Reading the config back is the counterpart to writing it: this operation returns the settings currently applied to the repository.
Return git commit history
logWhat you see in n8n
Notes & use cases
History becomes workflow data here: the operation returns commits, and pagination decides how many of them.
Key parameters
- Return All: on, n8n returns every commit; off, it stops at Limit.
- Limit: the maximum number of commits returned, available only while Return All is off.
- File: an option holding the path of a file or folder, absolute or relative to the Repository Path, to get the history of that path alone.
Pull from remote repository
pullWhat you see in n8n
Notes & use cases
Unlike Fetch, this one brings the remote changes into the working copy, so the files on disk end up matching what the remote holds.
Push to remote repository
pushWhat you see in n8n
Notes & use cases
Local commits stay local until this operation sends them to the remote, and it is the second place where authentication appears.
Key parameters
- Authentication: Authenticate to pass a Credential for Git in, None to push without one.
- Branch: an option naming the branch to switch to before pushing, placeholder
main; empty, the current branch is pushed. - Target Repository: an option holding the URL or path to push to, placeholder
https://github.com/n8n-io/n8n.
Push tags to remote repository
pushTagsWhat you see in n8n
Notes & use cases
Tags do not travel with an ordinary push, which is exactly the gap this operation fills. It sends the tags of the repository at the Repository Path to the remote.
Return reference log
reflogWhat you see in n8n
Notes & use cases
Where Log lists commits, the reference log lists where a reference has pointed over time, which is how you retrace a branch that moved.
Key parameters
- Reference: an option naming the reference to show the reflog for, a branch name for instance; left empty it uses HEAD, placeholder
HEAD. - Return All: on, every entry comes back; off, the result stops at Limit.
- Limit: the maximum number of entries to return.
Return status of current repository
statusWhat you see in n8n
Notes & use cases
Status answers one question, what is different right now between the working copy and the last commit.
Switch to a different branch
switchBranchWhat you see in n8n
Notes & use cases
Branch handling gets its own operation, and its options cover creating the branch as well as moving to it.
Key parameters
- Branch Name: the required name of the branch to switch to, placeholder
feature/new-feature. - Create Branch If Not Exists and Start Point: create the branch when it is missing, from the commit, branch or tag given as start point, or from the current HEAD.
- Force Switch, Set Upstream and Remote Name: force the move and discard local changes, track a remote branch, name the remote to track, placeholder
origin.
Create a new tag
tagWhat you see in n8n
Notes & use cases
A tag pins a name onto the current state of the repository, which is how a specific version gets something readable to refer to.
Key parameters
- Name: the required name of the tag to create.
Set up a user
userSetupWhat you see in n8n
Notes & use cases
Commits carry an author, and this operation sets the user for the repository without you having to spell out config keys.
Need help automating Git with n8n?
A person reads every message.
Git and n8n, questions people ask
01Is the n8n Git node free to use?
02What credentials does the Git node need?
03What are the limits of the Git node in n8n?
04Git node or HTTP Request for repository automation?
05n8n or Make for git automation?
Get our weekly integration tips.
No spam. Unsubscribe anytime.


