不同ref的GitHub到Gitlab的镜像问题
创始人
2025-01-09 14:30:15
0
  1. 在Gitlab上创建一个新的项目,该项目将用于托管GitHub的镜像。
  2. 在GitHub上创建一个Webhook,每当有新的push事件发生时都会触发该Webhook。
  3. 在Gitlab项目中设置Mirroring,将GitHub作为“upstream”镜像源,将Gitlab项目作为“downstream”镜像源。
  4. 在Mirroring设置中指定所需的Git Refs,以同步GitHub和Gitlab之间的镜像。

代码示例: 在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

相关内容

热门资讯

推荐十款!aapoker免费透... 推荐十款!aapoker免费透视脚本,wpk德州局怎么透视,真是是真的有挂(有挂透视)1、让任何用户...
教程攻略!pokermaste... 教程攻略!pokermaster修改器,pokerworld破解版下载,原来是有挂(的确有挂)1、免...
最新技巧!wepoker作弊视... 最新技巧!wepoker作弊视频,wpk真的有透视嘛,一直真的是有挂(有挂讲解)1、有没有辅助教程、...
实操分享!we-poker辅助... 实操分享!we-poker辅助器,德普之星透视辅助,都是真的有挂(有挂讲解)1、游戏颠覆性的策略玩法...
免费测试版!pokernow辅... 免费测试版!pokernow辅助控制,wepoker好友助力码,一贯是真的有挂(有挂辅助)1、免费辅...
玩家必看分享!xpoker辅助... 玩家必看分享!xpoker辅助工具,德州局怎么透视,好像真的有挂(发现有挂)所有人都在同一条线上,像...
玩家必看!wepoker透视脚... 玩家必看!wepoker透视脚本苹果版,hhpoker是正品吗,竟然真的有挂(有挂存在)1、在插件功...
大家学习交流!wepoker软... 大家学习交流!wepoker软件安装包,wepoker辅助是真的吗,一直存在有挂(有挂细节)1、每一...
一分钟了解!hardrock作... 一分钟了解!hardrock作弊,wepoker私人局外卦,确实真的是有挂(有挂头条)1、上手简单,...
关于!wepoker辅助透视软... 关于!wepoker辅助透视软件,大菠萝789辅助器下载,本来是有挂(有挂秘笈)一、wepoker辅...