V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
honglongmen
V2EX  ›  程序员

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

  •  
  •   honglongmen · Mar 10, 2019 · 4831 views
    This topic created in 2608 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
        1
    LuckyKoala  
       Mar 10, 2019 via Android   ❤️ 2
    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
        2
    IsaacYoung  
       Mar 10, 2019 via iPhone
    git remote
    mason961125
        3
    mason961125  
       Mar 10, 2019
    git remote 设置多个 origin 就好啦。
    honglongmen
        4
    honglongmen  
    OP
       Mar 11, 2019
    @LuckyKoala gitee/github 用户密码不一样怎么解决?
    zealic
        5
    zealic  
       Mar 11, 2019
    谁会用密码做同步?
    都是用的 key
    boris1993
        6
    boris1993  
       Mar 11, 2019 via Android   ❤️ 1
    您好,希望这篇文章可以帮到您呢

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