git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
panxianhai
V2EX  ›  git

有没有可能同时把代码提交到两个git代码托管的服务器上?

  •  1
     
  •   panxianhai · May 31, 2012 · 14080 views
    This topic created in 5279 days ago, the information mentioned may be changed or developed.
    我的电脑上有一个git版本库,有没有可能是当我push到一个git服务器上面的时候同时也更新到另外一个git服务器?
    11 replies  •  2016-04-22 16:02:06 +08:00
    messense
    messense
    May 31, 2012❤️1
    1
    git remote add origin xxx
    git remote add another yyy
    git push origin master
    git push another master

    这样行不?
    airyland
    airyland
    May 31, 2012
    2
    同ls,分两次提交就行了。
    poiyzy
    poiyzy
    May 31, 2012❤️12
    3
    我自己这样用
    vim .git/config

    [remote "web"]
    url = ssh://server.example.org/home/ams/website.git
    url = ssh://other.exaple.org/home/foo/website.git
    poiyzy
    poiyzy
    May 31, 2012
    4
    这样只需要 git push web 就两个都更新了
    sd4399340
    sd4399340
    May 31, 2012
    5
    @poiyzy 还可以这样啊,学习了
    xell
    xell
    May 31, 2012
    6
    @poiyzy 非常感谢,这种小细节帮了我大忙!
    panxianhai
    panxianhai
    OP
    May 31, 2012
    7
    @messense
    @poiyzy
    @airyland 感谢。
    ElmerZhang
    ElmerZhang
    May 31, 2012
    8
    @poiyzy 这技巧不错,收藏
    112582358
    112582358
    Jan 2, 2014
    9
    请问下如何添加两个不同仓库的不同分支呢?

    比如说:
    github的master,以及gitcafe的cafe-pages
    112582358
    112582358
    Jan 3, 2014
    10
    请问下如何添加两个不同仓库的不同分支呢?

    比如说:
    github的master,以及gitcafe的cafe-pages

    我的电脑上有一个git版本库,有没有可能是当我push到一个git服务器上面的时候同时也更新到另外一个git服务器?
    firstar
    firstar
    Apr 22, 2016
    11
    感谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   944 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:00 · PVG 04:00 · LAX 12:00 · JFK 15:00
    ♥ Do have faith in what you're doing.