【问题标题】:Merge commit from Master-branch to another branch, but not to merge two branches将主分支的提交合并到另一个分支,但不合并两个分支
【发布时间】:2014-07-10 17:16:48
【问题描述】:
  1. 我有一个带有一个主分支的 git 存储库。
  2. 我决定开发新功能并创建了新分支“new_branch”
  3. 我在“new_branch”中创建了一些提交,但我还没有完成新功能
  4. 我决定修复 master 分支中的一些 bug,所以我切换到 master 分支,修复代码并提交。

现在,我想将 Master 分支中的所有修复(所有提交)放入“new_branch”。但我不想将两个分支合并为一个,因为我的新功能还没有完全开发。我该怎么做?

【问题讨论】:

  • 合并不会消除分支。您可以将 master 合并到 new_branch 中,并且仍然有两个单独的分支可以处理。

标签: git


【解决方案1】:

将你的主分支合并到你的功能分支中。

git merge master new_branch

现在,master 中的修复已应用于new_branch,您可以继续在new_branch 上开发新功能。

【讨论】:

    猜你喜欢
    • 2016-03-23
    • 2013-11-09
    • 1970-01-01
    • 2021-12-29
    • 2021-11-13
    • 1970-01-01
    • 2018-03-12
    • 1970-01-01
    • 2018-05-26
    相关资源
    最近更新 更多