2020年1月1日 星期三

git rebase --onto

简单地说,git rebase --onto选择一系列提交并在作为参数给出的提交中重新定义它们。
阅读git rebase的手册页,搜索“到”。这些例子非常好:
example of --onto option is to rebase part of a branch. If we have the following situation:

                                   H---I---J topicB
                                  /
                         E---F---G  topicA
                        /
           A---B---C---D  master

   then the command

       git rebase --onto master topicA topicB

   would result in:

                        H'--I'--J'  topicB
                       /
                       | E---F---G  topicA
                       |/
           A---B---C---D  master
在这种情况下,您告诉git将topicA上的提交重新绑定到topicB之上的master

from : https://www.it-swarm.net/zh/git/%E6%88%91%E6%97%A0%E6%B3%95%E7%90%86%E8%A7%A3git-rebase-onto%E7%9A%84%E8%A1%8C%E4%B8%BA/1052063464/