设置私有 Fork
创建私有 Fork(私有 Piece)
按照以下步骤,你可以在 GitHub、GitLab 或其他平台上创建私有 Fork,并将”activepieces”仓库配置为上游源,从而能够合并”activepieces”仓库的变更。
- 克隆仓库:
首先创建仓库的裸克隆。请记住,这是临时步骤,稍后将被删除。
git clone --bare git@github.com:activepieces/activepieces.git
- 创建私有 Git 仓库
在 GitHub 或你选择的平台上创建一个新的私有仓库。在初始化新仓库时,不要包含 README、license 或 gitignore 文件。这一预防措施对于避免在将你的 Fork 与原始仓库同步时出现合并冲突至关重要。
- 镜像推送到私有仓库:
将之前创建的裸克隆镜像推送到你新创建的”activepieces”仓库。请务必将下面 URL 中的 <your_username> 替换为你的实际 GitHub 用户名。
cd activepieces.git
git push --mirror git@github.com:<your_username>/activepieces.git
- 删除临时本地仓库:
cd ..
rm -rf activepieces.git
- 克隆你的私有仓库:
现在,你可以将”activepieces”仓库克隆到本地机器的目标目录中。
cd ~/path/to/directory
git clone git@github.com:<your_username>/activepieces.git
- 添加原始仓库作为远程:
如果需要,你可以将原始仓库添加为远程仓库,以便获取未来的潜在变更。但请记住,禁用此远程的推送操作,因为你没有权限向其推送更改。
git remote add upstream git@github.com:activepieces/activepieces.git
git remote set-url --push upstream DISABLE
你可以使用 git remote -v 查看所有远程仓库列表。它应如下所示:
origin git@github.com:<your_username>/activepieces.git (fetch)
origin git@github.com:<your_username>/activepieces.git (push)
upstream git@github.com:activepieces/activepieces.git (fetch)
upstream DISABLE (push)
推送更改时,始终使用
git push origin。
同步你的 Fork
要从”upstream”仓库获取变更,请获取远程仓库并基于其变基你的工作。
git fetch upstream
git merge upstream/main
由于你只向仓库中添加了 Piece,通常不需要解决冲突。