The one simple trick to do a better job as a programmer is to git commit as if your commit could be accidentally deployed (and it wouldn't break the production environment..). If a commit needs to leave the project in a working state, you need to: Be able to prove that after making your changes, the project is in a working state.
Be able to make changes that don't break existing code, or that only add new features. This forces you think about first improving the existing code design to allow for your change to happen.
An amazing result of applying this process is that after some practice you'll be able to make many, much smaller commits during the day.