+4

Journal: Directly amend-commit to an older commit

ubruhin 2 years ago • updated by Thomas Singer 2 months ago 2

I like to have a clean history in my repositories and thus I do lot of rebasing and squashing on feature branches. And there is especially one task I do *very* often in the exact same way: Amend (parts of) local changes to older commits of the current feature branch because there was something missing/wrong in an older commit which I want to fixup now. This is my current workflow to do this:


- Stage changes which should be amended to an older commit

- Commit index into a (temporary) commit (with a random commit message like "asdf")

- Using drag&drop in the Journal, move the commit down the history, right after the commit to fixup

- Select both commits in the Journal and choose "Squash" from the context menu


This works pretty good (as long as there are no conflicts), but requires lot of clicks/typing/dragging every time. If I'm not the only one who often amends to older commits, it may be worth to implement a feature to make this easier ;)


Such a feature could look very simple: In the Journal, add a context menu item called something like "Amend current index". Then one needs to just stage the desired changes, right click on an older commit in the Journal, choose "Amend current index", and SmartGit would do the whole rebase operation.

+2

Or behind the Amend-checkbox a combobox with the amendable commits could be shown...

Right now, we enhanced the interactive rebase to highlight equal named commits, and provide options to squash them.