How to combine group of local commits to single push in IDEA? How to combine group of local commits to single push in IDEA? git git

How to combine group of local commits to single push in IDEA?


You can do it using rebase. Go to VCS/Git/Rebase. Then select Interactive option. It will show you a list of commits, where you can pick which ones you want to squash.

After you hit Start rebasing it will prompt you for a commit message for the squashed commit. After that is done you can push your squashed commit using push dialog.

Squash dialog

More information about rebase in IntelliJ is here.


There is a new way:

Version Control -> Log -> Right click on the commit -> Interactively rebase from here and then you can choose to pick/squash the rest of commits.


For me the simplest way with intellij is :

  • Go to Log tab and chose the commit from which you want to squash
  • Right click and select Reset Branch to this commit
  • Choose the Soft Or Mixin options to keep your changes from the commit
  • Commit your changes and don't forget to check the Amend commit option