2025-10-23, a Thursday

merge commits better than squash commits

todo: update date when written out

people use squash commits and rebases because they want their commit history to be clean. is this just for vanity?

merge commits are better:

only benefit of squash commits is to keep .git folder small (eg if you accidentally commit node modules in a PR then delete it)

looking online, the benefits of squash commits are:

should limit argument to just GitHub interface rather than git CLI (because GitHub shows PR info on hover)

when do people look at commit history? is there research on this

PRs should be small. but in practice for one reason or another some PRs end up very big (are there statistics on this)

do people use bisect or blame? can’t bisect on GitHub but blame is harder to use in git i guess


particularly relevant since LLMs can generate massive PRs that should be split up


git and github are made for merge commits. rebases and squash merges are a hack for people who care superficially about a “clean git history” as if anyone’s actually looking at it

why people use squash commits

why squash bad:

why rebase bad:

the only valid scenario for squash commits is for public open source repos where collaborators may sneak in diffs in intermediate commits. but for repos within a team (e.g. in a company) this is not a concern

See source and revision history on GitHub.

Write a comment