top | item 30260829

(no title)

colourgarden | 4 years ago

> every commit I make is a good one that I would like to keep in the history

This is certainly not typical.

When working in a team, you may need to push something half-finished so that someone else can work on what they need to. Or testing something before refactoring.

For these scenarios, rebase is very handy for cleaning things up before merging.

discuss

order

Double_a_92|4 years ago

Why can't the merged branch contain commits that don't compile? As long as it has a clean commit message, I don't see the issue. It's just part of the history. On that day you e.g. committed some broken prototype code so your teammate could improve it. So?

If I clean up something I only do it for new commits before they are ever pushed to remote. My rule is basically to never rewrite history, that someone else might already have checked out on their machine.