Generic Git
The Generic Git provider connects an environment to any Git repository by URL, including repositories on GitHub and Bitbucket. It authenticates with an SSH key or with a username and access token.
What Generic Git supports
Authentication
SSH key, or username and access token
Pick repositories and branches from a list
No. You enter the repository URL and branch.
Push each promote to a feature branch
Yes
Promotion reviews
No. Someone merges the feature branch on the Git host manually.
Connect with an SSH key
In the Connect Generic Git dialog, enter a Name and set Authentication to SSH key.
Choose the SSH key type. n8n generates the key pair.
Select Continue, then Copy deploy key.
On your Git host, add the key to the repository as a deploy key with write access.
Bitbucket Cloud only offers read-only repository access keys, so connect to Bitbucket Cloud with a username and access token, or add the deploy key to a Bitbucket account instead of the repository. An account key gives n8n access to every repository that account can access, so use a dedicated account.
To replace the key, edit the provider and select Generate a new key. Add the new key to your Git host, then remove the old key there.
Connect with a username and access token
In the Connect Generic Git dialog, enter a Name and set Authentication to Username and password.
Enter the Username and, in Password or access token, an access token with write access to the repository.
Select Continue.
Use an HTTPS repository URL without credentials in it, such as https://github.com/acme/n8n.git.
What access the token needs
Generic Git only runs Git commands. It doesn't call your Git host's API. The token needs read and write access to the repository's code. If you push each promote to a feature branch, it also needs permission to create branches.
Common Git hosts:
GitHub
Your GitHub username
Fine-grained personal access token for the repository with Contents: Read and write. This also covers creating branches.
GitLab
Your GitLab username
Personal, group, or project access token with the write_repository scope. For a fine-grained personal access token, add Code: Download, Push, and Branch: Create.
Bitbucket Cloud
Your Bitbucket username
API token with the read:repository:bitbucket and write:repository:bitbucket scopes.
You can't change the authentication method of a provider. To switch, create another provider.
Related resources
Last updated
Was this helpful?