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

请问 Gitflow 里 Hotfix 后为什么不将 master 分支 merge 回 develop 分支?

  •  
  •   starit · Oct 8, 2016 · 6509 views
    This topic created in 3683 days ago, the information mentioned may be changed or developed.
    如题。
    9 replies  •  2016-10-11 10:14:30 +08:00
    cielpy
    cielpy
    Oct 8, 2016
    1
    hotfix finish 后会合并进 master 和 develop 的

    yuankui
    yuankui
    Oct 8, 2016
    2
    merge 不 merge 都一样, master 是 develop 的子集。。
    yuankui
    yuankui
    Oct 8, 2016
    3
    按照 gitflow 的规定,所有往 master 合的分支,都有往 develop 里面合并

    不信你看图
    SourceMan
    SourceMan
    Oct 8, 2016
    4
    流程是会的,是不是跟 develop 冲突了,自动合并不进去?
    gitflow 只是约定了流程,帮你做了一些操作,不行就自己来就 OK 了
    starit
    starit
    OP
    Oct 10, 2016
    5
    @cielpy 你好,我知道会将 hotfix 分支合并进 develop 和 master ,但我的问题是为什么不将 hotfix 合并进 master ,然后将 master 合并进 develop 。
    cielpy
    cielpy
    Oct 10, 2016
    6
    @starit 按照 git-flow 的规则, master 是 develop 的子集,所有 master 分支的代码都是从 develop 合并过来的, master 是作为保存最新一次 release 的代码的,不存在从 master 合并进 develop 的场景吧。

    就作用上来讲, hotfix 完成后分别合并进 master 和 develp ,和先合并进 master 再合并进 develop 效果等价,因为 hotfix 开始时是直接从 master 开的分支,而 master 分支的所有代码 develop 分支都有, hotfix 完成后如果先合并进 master ,此时 master 分支也只比 develop 多了这个 hotfix 的代码,直接从 hotfix 分支合并到 develop 合并的也是同样的代码。
    starit
    starit
    OP
    Oct 10, 2016
    7
    @cielpy 我知道,那为什么选择这样做而不是那样做呢
    cielpy
    cielpy
    Oct 10, 2016
    8
    @starit 作者没有提到这个问题,猜想一下大概是操作习惯



    master 一直是作为保存最新的线上在跑的代码分支,一直是别的分支合并到 master
    starit
    starit
    OP
    Oct 11, 2016
    9
    @cielpy 好的,谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1506 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:47 · PVG 13:47 · LAX 21:47 · JFK 00:47
    ♥ Do have faith in what you're doing.