git commit --fixup <sha>
marks a commit as a fix of a previous commit. This gives it an automatic message referencing the commit.
git rebase --autosquash
can then squash all fixup commits.
https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html