The only use I could imagine is, if you have very short-lived branches (i.e. 1-2 days) with lots of random commits. Like e.g. "Oh I'm going for lunch, lets commit."
Using 'Git rebase' to Perfect Commits
21–24 of 24 posts
Re: Using 'Git rebase' to Perfect Commits
#22I still don't really understand why so many devs seem to have a need for this. For me every commit I make is a good one that I would like to keep in the history. Why should I need to reorder or rename or group any of my commits? All my work (of days or even weeks) is neatly containted within one branch, and that branch gets merged at the end. Why is that not ok? Why should I hide my work history into one "blob" commi…
Re: Using 'Git rebase' to Perfect Commits
#23I still don't really understand why so many devs seem to have a need for this. For me every commit I make is a good one that I would like to keep in the history. Why should I need to reorder or rename or group any of my commits? All my work (of days or even weeks) is neatly containted within one branch, and that branch gets merged at the end. Why is that not ok? Why should I hide my work history into one "blob" commi…
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.
Re: Using 'Git rebase' to Perfect Commits
#24I still don't really understand why so many devs seem to have a need for this. For me every commit I make is a good one that I would like to keep in the history. Why should I need to reorder or rename or group any of my commits? All my work (of days or even weeks) is neatly containted within one branch, and that branch gets merged at the end. Why is that not ok? Why should I hide my work history into one "blob" commi…
> 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.
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.