步骤
在 Gitlab 项目中选择 Settings -> Reposiroty -> Mirror a repository
在 Git repository URL 中输入 Github 的 url,但是格式有要求的,
格式要求是:
https://username@gitlab.company.com/group/project.git
这里的 group 其实就是你自己的 github 用户名。
例如,我的 github repo url 是:
https://github.com/AdoBeatTheWorld/goserver.git
在这里我需要输入的是:
https://AdoBeatTheWorld@github.com/AdoBeatTheWorld/goserver.git
选择 Mirror Direction 为 Push
在Password中填入Github的登陆密码
点击Mirror repository按钮
会在Mirrored repositories中生成一条新的记录
点击垃圾桶旁边的刷新按钮
刷新页面就可以看到时候刷新成功,刷新成功的话Last update会从 never 变成 just now
此时去看对应的 Github 项目就会发现已经更新了