• 请不要在回答技术问题时复制粘贴 AI 生成的内容
honglongmen
V2EX  ›  程序员

自建的 gitlab 如何和自 github 导入的项目保持代码一直更新?

  •  
  •   honglongmen · Mar 25, 2019 · 5653 views
    This topic created in 2786 days ago, the information mentioned may be changed or developed.

    自己建了个 gitlab,从 github 导入了几个不错的项目玩玩, 请问如何保持自己 gitlab 上项目代码和 github 原始代码同步更新?

    11 replies  •  2019-03-25 19:07:12 +08:00
    Sharuru
    Sharuru
    Mar 25, 2019 via Android
    1
    Gitlab EE 版本及以上有 Mirror 功能可以定时同步。
    CE 版本的话,cron 自己写个定时任务,大概三行就完事儿了。
    或者再稍微复杂点听 webhook 也是可以的。
    msg7086
    msg7086
    Mar 25, 2019 via Android
    2
    自己拉推。
    daimazha
    daimazha
    Mar 25, 2019
    3
    添加个 github 项目的 remote, 自己拉 merge
    Rwing
    Rwing
    Mar 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.
    honglongmen
    honglongmen
    OP
    Mar 25, 2019
    5
    @Sharuru cron 如何操作? CE 版本的.
    joesonw
    joesonw
    Mar 25, 2019
    6
    @honglongmen `git pull origin master` `git push remote master` ????
    4BVL25L90W260T9U
    4BVL25L90W260T9U
    Mar 25, 2019
    7
    换 gitea 吧,gitlab 那么臃肿。。
    HangoX
    HangoX
    Mar 25, 2019
    8
    gitlab 本身在 setting 中支持 mirror 功能
    honglongmen
    honglongmen
    OP
    Mar 25, 2019
    9
    @HangoX 我是看到了 Mirror,但是不知道怎么用.
    honglongmen
    honglongmen
    OP
    Mar 25, 2019
    10
    @HangoX https://code.xxx.com/help/workflow/repository_mirroring ,看到了帮助,但是只支持 Push 到 mirror 仓库,而我是想反过来,github push 到 gitlab,难道只能在 github 先 fork 然后 github 上 push?
    HangoX
    HangoX
    Mar 25, 2019
    11
    gitlab 官方版本 push 和 pull 都支持,不知道自己建的版本是否支持。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4027 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 07:32 · PVG 15:32 · LAX 23:32 · JFK 02:32
    ♥ Do have faith in what you're doing.