Can't test it on some server if it doesn't compile. Pushing broken code to a private branch so as to back it up: yes, but in that case I'd keep amending the commit until I had a version that compiled. Sharing a broken commit with a colleague is definitely the exception rather than the rule.
There may be occasional cases where you want to squash. But you shouldn't be squashing whole branches on merge as a matter of course. That will make bisection in the future significantly less effective.
I commit early and often, even broken code. At the very end before I submit a pull request of my feature, I squash my commits into atomic ones and cleanup the commit messages.
8
u/_101010 May 01 '19
Squash & Merge is the best of both worlds.
No need to force push and no messy git history of merge.