自己建了个 gitlab,从 github 导入了几个不错的项目玩玩, 请问如何保持自己 gitlab 上项目代码和 github 原始代码同步更新?
自己建了个 gitlab,从 github 导入了几个不错的项目玩玩, 请问如何保持自己 gitlab 上项目代码和 github 原始代码同步更新?
|
SharuruMar 25, 2019 via Android
1
Gitlab EE 版本及以上有 Mirror 功能可以定时同步。
CE 版本的话,cron 自己写个定时任务,大概三行就完事儿了。 或者再稍微复杂点听 webhook 也是可以的。 |
|
msg7086Mar 25, 2019 via Android
2
自己拉推。
|
|
daimazhaMar 25, 2019
3
添加个 github 项目的 remote, 自己拉 merge
|
|
RwingMar 25, 2019
4
https://github.com/samrocketman/gitlab-mirrors
The gitlab-mirrors project is designed to fill in a feature which is currently missing from GitLab: the ability to mirror remote repositories. gitlab-mirrors creates read only copies of remote repositories in gitlab. It provides a CLI management interface for managing the mirrored repositories (e.g. add, delete, update) so that an admin may regularly update all mirrors using crontab. It operates by interacting with the GitLab API using python-gitlab. |
|
5
@Sharuru cron 如何操作? CE 版本的.
|
|
joesonwMar 25, 2019
6
@honglongmen `git pull origin master` `git push remote master` ????
|
|
4BVL25L90W260T9UMar 25, 2019
7
换 gitea 吧,gitlab 那么臃肿。。
|
|
HangoXMar 25, 2019
8
gitlab 本身在 setting 中支持 mirror 功能
|
|
9
@HangoX 我是看到了 Mirror,但是不知道怎么用.
|
|
10
@HangoX https://code.xxx.com/help/workflow/repository_mirroring ,看到了帮助,但是只支持 Push 到 mirror 仓库,而我是想反过来,github push 到 gitlab,难道只能在 github 先 fork 然后 github 上 push?
|
|
HangoXMar 25, 2019
11
gitlab 官方版本 push 和 pull 都支持,不知道自己建的版本是否支持。
|