C0VN
V2EX  ›  问与答

Git 怎样设置一次性提交到两个不同的仓库中去?

  •  
  •   C0VN · Dec 11, 2014 · 3178 views
    This topic created in 4233 days ago, the information mentioned may be changed or developed.
    比如一个是github上的,一个是国内coding.net上面。

    上面的项目是一样的

    该如何设置?
    5 replies    2014-12-11 22:43:53 +08:00
    yfdyh000
        1
    yfdyh000  
       Dec 11, 2014
    aa65535
        2
    aa65535  
       Dec 11, 2014
    [remote "origin"]
        url = git@github
        pushURL = git@github
        pushURL = git@coding
        fetch = +refs/heads/*:refs/remotes/origin/*

    pull 的时候使用 url ,push的时候使用 pushURL
    C0VN
        3
    C0VN  
    OP
       Dec 11, 2014
    @aa65535 那之前 git clone 和 add、commit 的过程是怎么弄的?
    aa65535
        4
    aa65535  
       Dec 11, 2014
    @xavierskip 可以直接编辑 .git/config
    其他操作照旧。
    tomliu
        5
    tomliu  
       Dec 11, 2014
    git remote set-url --add --push origin xxxxxxxxx
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3136 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 12:28 · PVG 20:28 · LAX 05:28 · JFK 08:28
    ♥ Do have faith in what you're doing.