How can I squash a range of git commits together given starting and ending SHA's

后端 未结 4 1893
一向
一向 2021-02-07 03:19

I have a branch with about 20 commits.

The first SHA on the branch is bc3c488...
The last SHA on the branch is 2c2be6...

How can I

4条回答
  •  一整个雨季
    2021-02-07 04:07

    you can use the interactive shell in git rebase to selectively pick which commits to rebase.

    git rebase -i bc3c488...

    then change the commits that you want to squash to say squash instead of pick

    checkout https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/

提交回复
热议问题