Pre-commit formatting. When I use IntelliJ to commit, it automatically formats pre commit.
If you format post commit, you need another commit to format, and then your commit history will have many formatting commits.<p>I will suggest use an IDE to auto format pre push, or use a git pre commit hook to format before commit.