Git 和 n8n#
¥Git and n8n
n8n 使用 Git 进行源代码控制。要使用此功能,建议你具备一些基本的 Git 概念知识。n8n 未实现所有 Git 功能:你不应该将 n8n 的源代码控制视为完整的版本控制。
¥n8n uses Git to provide source control. To use this feature, it helps to have some knowledge of basic Git concepts. n8n doesn't implement all Git functionality: you shouldn't view n8n's source control as full version control.
New to Git and source control?
如果你是 Git 新手,请不要担心。你无需学习 Git 即可使用 n8n。本文档解释了你需要了解的概念。设置源代码控制需要一些 Git 知识,因为这涉及到 Git 提供商的操作。
¥If you're new to Git, don't panic. You don't need to learn Git to use n8n. This document explains the concepts you need. You do need some Git knowledge to set up the source control, as this involves work in your Git provider.
Familiar with Git and source control?
如果你熟悉 Git,请不要依赖行为完全匹配。特别需要注意的是,n8n 中的源代码控制不支持拉取请求式的审查和合并流程,除非你在 n8n 之外的 Git 提供程序中执行此操作。
¥If you're familiar with Git, don't rely on behaviors matching exactly. In particular, be aware that source control in n8n doesn't support a pull request-style review and merge process, unless you do this outside n8n in your Git provider.
本页介绍 n8n 中使用的 Git 概念和术语。它不涵盖设置和管理存储库所需的所有内容。执行 设置 操作的人员应熟悉 Git 及其 Git 托管服务提供商。
¥This page introduces the Git concepts and terminology used in n8n. It doesn't cover everything you need to set up and manage a repository. The person doing the Setup should have some familiarity with Git and with their Git hosting provider.
This is a brief introduction
Git 是一个复杂的主题。本节简要介绍了在 n8n 中使用环境时需要用到的关键术语。如果你想深入了解 Git,请参考 GitHub | Git 和 GitHub 学习资源。
¥Git is a complex topic. This section provides a brief introduction to the key terms you need when using environments in n8n. If you want to learn about Git in depth, refer to GitHub | Git and GitHub learning resources.
Git 概述#
¥Git overview
Git 是一款用于管理、跟踪和协作处理多个文档版本的工具。它是 GitHub 和 GitLab 等广泛使用平台的基础。
¥Git is a tool for managing, tracking, and collaborating on multiple versions of documents. It's the basis for widely used platforms such as GitHub and GitLab.
分支:项目的多个副本#
¥Branches: Multiple copies of a project
Git 使用分支来维护文档的多个副本。每个分支都有自己的版本。常见的模式是创建一个主分支,然后所有想要为项目做贡献的人都在各自的分支(副本)上工作。当工作流完成其工作后,其分支会合并回主分支。
¥Git uses branches to maintain multiple copies of a document alongside each other. Every branch has its own version. A common pattern is to have a main branch, and then everyone who wants to contribute to the project works on their own branch (copy). When they finish their work, their branch is merged back into the main branch.
本地和远程:在你的计算机和 Git 提供商之间移动工作#
¥Local and remote: Moving work between your machine and a Git provider
使用 Git 的常见模式是在自己的计算机上安装 Git,然后使用 GitHub 等 Git 提供商在云端使用 Git。实际上,你在 GitHub 上有一个 Git 仓库(项目),并在本地计算机上使用它的副本。
¥A common pattern when using Git is to install Git on your own computer, and use a Git provider such as GitHub to work with Git in the cloud. In effect, you have a Git repository (project) on GitHub, and work with copies of it on your local machine.
n8n 使用此模式进行源代码控制:你将在 n8n 实例上处理你的工作流,但会将它们发送到你的 Git 提供商进行存储。
¥n8n uses this pattern for source control: you'll work with your workflows on your n8n instance, but send them to your Git provider to store them.
推送、拉取和提交#
¥Push, pull, and commit
n8n 使用三个关键的 Git 进程:
¥n8n uses three key Git processes:
- 点击:将实例中的工作发送到 Git。此操作会将你的工作流、标签以及凭据和变量存根的副本保存到 Git。你可以选择要保存的工作流。
¥Push: send work from your instance to Git. This saves a copy of your workflows and tags, as well as credential and variable stubs, to Git. You can choose which workflows you want to save.
- 拉取:从 Git 获取工作流、标签和变量,并将其加载到 n8n 中。你需要填写刷新项中包含的任何凭据或变量存根。
¥Pull: get the workflows, tags, and variables from Git and load it into n8n. You will need to populate any credentials or variable stubs included in the refreshed items.
Pulling overwrites your work
1 | |
- 提交:n8n 中的一次提交是指将工作推送到 Git 的单次操作。在 n8n 中,提交和推送同时进行。
¥Commit: a commit in n8n is a single occurrence of pushing work to Git. In n8n, commit and push happen at the same time.
有关 n8n 如何与 Git 交互的详细信息,请联系 推送和拉取。
¥Refer to Push and pull for detailed information about how n8n interacts with Git.
