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

gitee 上的代码是如何同步复制到 github 上做个同步备份的?

  •  
  •   honglongmen · Mar 10, 2019 · 5215 views
    This topic created in 2794 days ago, the information mentioned may be changed or developed.

    狡兔三窟是最基本的道理,请问各位是如何做到平时日常使用 gitee,但更新时候同时推送一个到 github 上的 repo?

    Supplement 1  ·  Apr 4, 2019
    备注下: 今天发现应该本身就自带了 mirror 功能可以做到:
    https://gitlab.com/help/workflow/repository_mirroring
    11 replies  •  2019-03-14 19:48:38 +08:00
    LuckyKoala
    LuckyKoala
    Mar 10, 2019 via Android❤️2
    1
    git remote add origin gitee.com/...
    git remote add mirror github.com/...
    gitpush() {
    git push origin "$1"
    git push mirror "$1"
    }

    usage: gitpush master
    IsaacYoung
    IsaacYoung
    Mar 10, 2019 via iPhone
    2
    git remote
    mason961125
    mason961125
    Mar 10, 2019
    3
    git remote 设置多个 origin 就好啦。
    honglongmen
    honglongmen
    OP
    Mar 11, 2019
    4
    @LuckyKoala gitee/github 用户密码不一样怎么解决?
    zealic
    zealic
    Mar 11, 2019
    5
    谁会用密码做同步?
    都是用的 key
    boris1993
    boris1993
    Mar 11, 2019 via Android❤️1
    6
    您好,希望这篇文章可以帮到您呢

    https://www.boris1993.tk/tools/git/push-to-multi-git-repo.html
    honglongmen
    honglongmen
    OP
    Mar 11, 2019
    7
    @boris1993 thanks,很有用
    @zealic 个人喜欢密码,毕竟我不是专业做运维和开发,仅仅是兼职下技术方面事情.
    honglongmen
    honglongmen
    OP
    Mar 11, 2019
    8
    @zealic 不过你说的对,刚把 key 启用了,方便了.
    jlhde123
    jlhde123
    Mar 11, 2019
    9
    git push all
    honglongmen
    honglongmen
    OP
    Mar 11, 2019
    10
    @jlhde123 那 pull 呢?
    Allianzcortex
    Allianzcortex
    Mar 14, 2019 via iPhone❤️2
    11
    @boris1993 一直订阅的这个博客 http://www.gnailuy.com/linux/2019/02/25/git-push-to-multiple-repositories/ 这篇文章比你要早一天 LOL
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4960 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 00:13 · PVG 08:13 · LAX 16:13 · JFK 19:13
    ♥ Do have faith in what you're doing.