wity_lv
V2EX  ›  问与答

Git如何远程同步分支, 服务器

  •  
  •   wity_lv · Oct 24, 2013 · 17866 views
    This topic created in 4609 days ago, the information mentioned may be changed or developed.
    Git服务器: Gitosis
    平时和同事使用 master 分支进行 push/pull 。
    现在需要同步其他分支,不知道如何同步。

    git remote -v

    origin [email protected]:repositories/biandan.git (fetch)
    origin [email protected]:repositories/biandan.git (push)


    git branch

    fuzhou_2011
    guangzhou_2013
    * master
    yangzhou_2012
    Supplement 1  ·  Oct 24, 2013
    搞定了.
    推送分支到服务器:
    git push origin yangzhou_2012

    git branch -r
    origin/HEAD -> origin/master
    origin/fuzhou_2011
    origin/guangzhou_2013
    origin/master
    origin/yangzhou_2012

    其他人同步:
    git fetch origin #获取远程仓库信息
    git co -b yangzhou_2012 origin/yangzhou_2012
    4 replies    1970-01-01 08:00:00 +08:00
    welsonla
        1
    welsonla  
       Oct 24, 2013
    git fetch可以吗
    wity_lv
        2
    wity_lv  
    OP
       Oct 24, 2013
    git fetch 什么意思?
    origin同步的是 refs/heads/master . fetch操作也是在master上进行的。
    不知道怎么同步其他分支。
    wity_lv
        3
    wity_lv  
    OP
       Oct 24, 2013
    @welsonla 怎么将branch push远程?
    welsonla
        4
    welsonla  
       Oct 24, 2013
    我理解错了,我以为你不能把远程的branch取到本地呢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   845 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:51 · PVG 05:51 · LAX 14:51 · JFK 17:51
    ♥ Do have faith in what you're doing.