Another thing you can do is to publish source code for releases only.
By keeping the commits internal you don't have to think hard about what you commit and it allows to have other stuff in your repository that logically belongs there but is not suitable for a public release (internal tooling, things used to create the source code initially but not required, etc.).
By keeping the commits internal you don't have to think hard about what you commit and it allows to have other stuff in your repository that logically belongs there but is not suitable for a public release (internal tooling, things used to create the source code initially but not required, etc.).