How do I rebase a chain of local git branches?

前端 未结 4 1416
别那么骄傲
别那么骄傲 2020-12-09 09:28

Suppose I have a chain of local git branches, like this:

       master    branch1   branch2
          |         |         |
o----o----o----A----B----C----D
<         


        
4条回答
  •  借酒劲吻你
    2020-12-09 09:30

    This question is a subset of Modify base branch and rebase all children at once

    I recently started using git-chain which is a tool to solve this problem.

    Basically you specify a chain

    git chain setup -c myfeature master branch1 branch2
    

    Once this chain is set up, you can pull in commits from master, then you can run git chain rebase -c myfeature and the tool figures out all the refs and rebases everything nicely for you.

    As an added benefit, it also calculates and handles any amendments or new commits to branch1 and branch2.

提交回复
热议问题