NonClockworkChen
V2EX  ›  问与答

求指导如何把超前的 HEAD 合并到落后的 master 分支上....

  •  
  •   NonClockworkChen · Sep 28, 2017 · 4447 views
    This topic created in 3151 days ago, the information mentioned may be changed or developed.
    百度了一下,还是缺点什么,不太会弄...

    5 replies    2017-09-29 01:16:48 +08:00
    wellsc
        1
    wellsc  
       Sep 28, 2017   ❤️ 1
    试试 rebase
    faceair
        2
    faceair  
       Sep 28, 2017   ❤️ 1
    先把没提交的代码 commit 一次,再按一楼说的 rebase 到 upsteam/master
    rashawn
        3
    rashawn  
       Sep 28, 2017 via iPhone   ❤️ 1
    难道不是 merge 就可以了吗 难道每次合并都是把旧的 Head 合并到新的代码里?
    Muninn
        4
    Muninn  
       Sep 28, 2017   ❤️ 1
    难道不是 merge 就可以了吗。。。去看 git 基础教程吧
    billlee
        5
    billlee  
       Sep 29, 2017   ❤️ 1
    你是怎么把 HEAD 移到没有分支的地方的。。。
    git checkout -b develop
    git stash
    git checkout master
    git merge --ff-only upstream/master
    git checkout develop
    git rebase master
    git stash pop
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1229 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 235ms · UTC 17:42 · PVG 01:42 · LAX 10:42 · JFK 13:42
    ♥ Do have faith in what you're doing.