0

After multiple commits in my feature branch, normally I do git rebase -i development and then assuming there is no conflict, I see the list of commits to pick/squash/fixup etc.

My workflow is to generally pick first and squash all the remaining commits and then modify the huge combined message to my liking and then save (which commits)

My issue is that I have to manually change all the subsequent(after the first) picks to squash. If I have many commits, this is a boring task. Yeah, my editor could help with that but I was wondering if there is a a git command for that.

So, is there a git command which automatically squashes all the commits but just before finishing will show me all my commit messages which I can edit and then save which will perform the final commit with my edited message.

2
  • 1
    There isn't a short command for this, but you could write one if you like. There is a different shortcut, using git reset --soft; this requires that you reconstruct the entire commit message from scratch, but you could write your own command that makes that more convenient. The two aren't equivalent if you're rebasing onto a new target commit, but are equivalent if you're not.
    – torek
    Commented Sep 3, 2021 at 21:45

0

Browse other questions tagged or ask your own question.