Intellij - How to squash local branch only Intellij - How to squash local branch only git git

Intellij - How to squash local branch only


It might be a little uncomfortable but you can use the git notation of HEAD~so in the "Onto" field you'd write the amount of commits you want to includelike:

In this example I have 4 (the last 4) commits I want to combine into 1.

rebase interactive dialogue

In the opening dialog the entries are listed in order, so you needto squash all after the first one with the drop box. (I made the firsta reword but that's not needed as there will be a message-change dialogfor the squashing anyway, so it can be left on 'pick')

squashing

then just a new message for the combined commits and you're done.

commit message


If you want something like "git merge -squash" means merge a branch to another branch (possibly "master") with one commit contains all of the changes, you can use "Merge Changes..." option in Intellij. Just double press shift and type "Merge Changes". In the opened dialog select what branch you want to merge and then select "Squash commit" option.

enter image description here