|
|
|
|
|
by jamalaramala
567 days ago
|
|
I think it is a good practice to clean up your branch before you merge it into master. So instead of: * Change 1
* Fix typo
* Change 2
* Another typo
* Change 3
* That didn't work
* Ops, I did it again
* Revert Change 3
* Change 3 (final)
You'll merge: * Change 1
* Change 2
* Change 3
Which is much better, particularly if you have hundreds of developers working on the same codebase.And it is very easy to do that using `git rebase -i`. (I don't see the need for a GUI) |
|
I can also see value there if you're not squashing commits at the PR level. I prefer just squashing commits so main becomes:
etc.The individual branches have the "dirty" history which can be useful, and main is kept neat by having feature of fix-level changes which are quality controlled through gated-commits.
If you had to work on long-running feature branches which were more of a free-for-all so /branches/feature effectively becomes your "main" then I could see much more of an argument for re-writing history of individual contributors before merging into that feature branch.
I'd still argue you should just set up proper quality control on the feature branch and squash commits going into that, but that's the kind of overhead that can frustrate some teams, so I can better understand now the desire for a half-way cleaning between squashing and the full dirty history.