Is there a way to remove unused imports in Intellij IDEA on commit?
It is not very optimal to do it manually, CTRL + ALT + O helps but it's still manual.
If you are using IntelliJ IDEA or Android Studio:
Go to Settings > Editor > General >Auto Import and check the Optimize imports on the fly checkbox.