+2

New commit & squash command

Pierre Goiffon 2 weeks ago 0

From time to time I find that one of my modifications would better fit in an unpushed commit that is not the last one. For example I've git commit A, B, C, I have modifications in my working tree, and I find that one hunk should fit in commit B.


In such situation, I :

* commit the concerned hunks

* in the commit dialog select the commit B message

* commit

* in the log view, launch an interactive rebase

* click on the "auto squash" button

* validate


Having in the commit dialog the option to directly squash staged hunks in a defined commit would be fine !

So in this example, stage the hunks, open the commit dialog, select the squash option, selection commit B, validate.