Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto format the code before commit in IntelliJ?

Whenever I commit and push my code to git, it shows most of the formatting changes in merge request. I am using intellij as code editor. Is there anyway to auto format the whole project before committing changes ? So at least my merge request should not have code formatting changes every time.

like image 334
Javed Ahmed Avatar asked Jan 02 '23 05:01

Javed Ahmed


1 Answers

Open Settings > Version Control > Commit Select on the bottom right under "Before Commit" the Reformat code checkbox. enter image description here

like image 99
Sofiene Avatar answered Jan 04 '23 17:01

Sofiene