I don't know exactly how to describe it in Git terms but what I do is:
- I make some changes, commit it to a "Add a search box" commit
- I realized I had a parenthesis missing in my code, change it, commit it as "fix"
Then
git rebase -i HEAD~2
:pick 34ea25a Add a search box f 9c4b283 fix
Save the file
- And yeah, I have a nice history
But I would like to automate that, so how can I use git rebase without having to open an editor?