rebase to squash multiple commits on same branch

前端 未结 2 1506
执念已碎
执念已碎 2021-02-14 04:55

Can we use rebase to squash multiple commits into one single commit on the same branch?

Taking an example, i have created two topic branches - issueA_1 and issueA_2 from

2条回答
  •  滥情空心
    2021-02-14 05:35

    In your case,

    git checkout issueA_2
    git rebase -i master
    

    or

    git rebase -i commitX1^ #parent of commitX1 in branch issueA_2
    

    should also work. In this case, you don't need to count (I'm usually one off).

提交回复
热议问题