0

I would like to squash all commits between 2 commit id's. Commit id 08f68388387e81aaff8e8cdfa619b6c23adef39d is the first commit I made on the branch, and I would like to squash all commits till and including d3ccda596adf33f38a6ad3f9bdf63a43713b6343 which is like the 23rd commit on the branch (of 30).

3
  • 1
    I usually do this with an interactive rebase like this: git rebase -i HEAD~30. Then replace the word pick in front of all commits with the word fixup. This will squash the commit into the previous commit while retaining only the commit message of the first commit
    – PiFanatic
    Commented Aug 9, 2022 at 13:39
  • 2
    or git rebase -i --root, given that you want to start playing with revisions from the very first one.
    – eftshift0
    Commented Aug 9, 2022 at 13:58

0

Browse other questions tagged or ask your own question.