Collapsing a Group of Commits into One on Git

前端 未结 4 931
陌清茗
陌清茗 2020-12-23 02:23

I have the habit of making a huge number of small commits, and I\'m fine with it. But I would like to, from time to time, take a bunch of those linear commits and collapse t

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-23 02:51

    Suppose you want to rewrite the history of the tree going back until (but not including) commit a739b0d.

    export EDITOR=vim # or your favorite editor
    git rebase a739b0d --interactive
    

    Be sure to read up on interactive rebasing first.

提交回复
热议问题