4 ms·
Rebase is useful for artificially straightening out simultaneous work. It's less clear in the above example, where d is just a single commit. But if there's a
by jfengel 6y ago
Rebase is useful for artificially straightening out simultaneous work.
It's less clear in the above example, where d is just a single commit. But if there's a d1--d2--d3--d4, it can be confusing to merge chronologically (d1--d2--e--d3--f--d4).
If there aren't any conflicts, it's conceptually simpler in the long run to rebase it as e--f--d1--d2--d3--d4. You artificially serialize the work, which isn't what actually happened, but it could have happened that way. When you go back and look at it, pretending that it did is simpler. For example, if you have to go back and debug something that happened while working on d1...d4.
It's not absolutely mandatory to learn about it. But it the simple cases are common enough, and useful enough, that it's worth learning.