Hacker News new | ask | show | jobs
by PascalPrecht 2327 days ago
You should!

If there's one tool I'd recommend everyone to learn it's rebasing. Especially interactive rebasing because it enables things like splitting commits apart, squashing them together and even run automated programs.

1 comments

The interactive tools exist outside of rebase. You can also split commits apart as you work on them with for example `git add -i` without needing to rebase.

I've met junior developers I'd never trust to get rebase right, but interactive add was an important tool to teach them.

`git add i` is indeed powerful and lets you interactively craft your index before you create a commit. It doesn't enable you to split up an existing commit though.
Interactive hunk splitting the index maps to the mental model of "splitting the work in progress commit". That may be all a developer needs in a "rebase never" workflow.
Certainly can not disagree :)

I'm not trying to convince anyone here. By now I've sold over 230 copies and I"m getting really positive feedback. So it must be useful to someone.