代码示例: 在Gitlab项目中设置Mirroring的示例代码:
git clone https://github.com/my-org/my-repo.git
cd my-repo
git remote add upstream https://github.com/other-org/other-repo.git
git push --mirror git@gitlab.com/my-org/my-repo.git
# 在Gitlab项目中启用Mirroring
Settings -> Repository -> Mirroring repositories
Upstream mirror URL:https://github.com/other-org/other-repo.git
Mirror direction:Pull from a remote repository
Mirror automatically:勾选
Only mirror protected branches:不勾选
# 配置Mirroring要同步的Refs
Advanced settings -> Mirror direction -> Only mirror protected branches -> Add protected branch
Protected branch name:refs/heads/master
Save changes
上一篇:不同RDMA库之间的关系
下一篇:不同人口数量时更改y轴数字