Hacker News new | ask | show | jobs
by 2T1Qka0rEiPr 3204 days ago
I tend to use rebase solely for the purposes of creating tidy commits before I merge my changes into a staging branch.

For example when I'm working on a feature I tend to do n things at once, but I then want to create logical commits which separate the work into logical unit which could be reverted etc. as necessary. If in this process I notice that I've forgotten something (or for that matter, realise later than I've introduced a bug / broken tests) I'll tend to create a patch commit for that logical unit and then `git rebase -i HEAD~n` and then fixup that patch into the original commit.

Also, whenever I'm done for the day instead of stashing I: `git commit -am "wip"; git push; git reset HEAD~1 --soft` (i.e. push my changes up to Origin to avoid any localized mishaps with my PC resulting in a loss of work). I then force push to my feature branch.

I know that both of these "change history", but as long as they're isolated to my own feature branches I see no reason to avoid doing so...