I've seen lots of blog posts about using git commit --amend
, or rebasing to squash commits.
I find it a bit easier to git reset to the last checkpoint (say before all my 'save point' microcommits) and then use interactive adding to pick out the best order of commits.
Is there a downside to this?
I'm wondering b/c as most of the blogs I read use amend or rebase for this purpose
The downside is for you to pick again all the individual files in order to group them again in commits.
If your commits needs to be grouped together (without having to add or remove files in those commits), then a rebase --interactive is easier: you reason in term of set of files committed.
Actually, with the right commit comments, a rebase --interactive --autosquash
can do the reordering for you.
If your commits are purely intermediate save point, without much thought as their composition in term of set of files, then your solution is adequate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With