【问题标题】:How to update the head of a branch when one of its ancestor commits was updated in another branch当一个祖先提交在另一个分支中更新时如何更新分支的头部
【发布时间】:2014-03-26 21:45:24
【问题描述】:
master ---A---B
               \
feature1        C

有两个像上面这样的分支。在提交 C 之后,我使用“git commit --amend”修改了版本 B。修订版 C 是否可以继承我对 B 所做的更改?

【问题讨论】:

    标签: git git-rebase git-amend


    【解决方案1】:

    这将在提交 b 上重放 c 中的更改:

    git checkout feature1
    git rebase b
    

    或:

    git checkout feature1
    git rebase master
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-13
      • 2022-11-28
      • 2021-12-29
      • 2022-10-25
      • 2021-08-24
      • 1970-01-01
      • 2016-09-15
      相关资源
      最近更新 更多