3 ms·
Commits are immutable; when you squash commits you're replacing them with new ones and rewriting the history. And since there is no difference between your loca
by phailhaus 10y ago
Commits are immutable; when you squash commits you're replacing them with new ones and rewriting the history. And since there is no difference between your local repository and the remote one, the reason why you wouldn't squash commits on the remote repository is to be nice to your coworkers.
So unlike PR's, if your coworkers criticize your commit messages it's already too late.
- CydeWeys 10y ago> And since there is no difference between your local repository and the remote one Uhh, there's plenty of difference between your local repository and the remote one. One is local and used just by you and one is remote and used by many, for starters. Changes aren't automatically synced between them. You can rewrite commits locally to your heart's content (which I do all the time). You aren't "locked in" to anything until you've pushed it to a shared repository and someone syncs from it.
- phailhaus 10y agoAll those differences you mentioned are not related to implementation. The remote repo is functionally identical to your local repo. You can "rewrite commits to your heart's content" on the remote repo too, there is nothing stopping you. Like I said, the only reason you don't is to be nice to your coworkers. By the time somebody else criticizes your commit messages, you've already pushed. It's too late. All that time you had while the commit was local-only means nothing, unless you brought your coworkers over to your computer to review your commits before creating a PR. Expecting developers to get commits right the first time (before pushing) is not a sustainable solution.