Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable automatic code rearrangement in Intellij IDEA

After I updated IntelliJ IDEA, it started to rearrange code before each git commit. I found rearrange rules in Settings > Editor > Code Style > Java but there is no checkbox for enable/disable feature.
How can I disable it?

like image 292
Alexander Mann Avatar asked Aug 24 '16 11:08

Alexander Mann


People also ask

How do I stop auto formatting in IntelliJ?

In Preferences > Editor > Code style > [language] uncheck reformat on file save .

How do I stop IntelliJ from changing imports?

To avoid IntelliJ IDEA replacing imports with * , you need to configure the Class count to use import with '*' and Names count to use static import with '*' preferences: Go to Preferences > Editor > Code Style > Java.

What does rearrange code do in IntelliJ?

Rearrange code just does the 1st point, arranges it according to android code style guidelines. Reformat code does both 1st and 2nd point. Show activity on this post. Rearranging code does more things than just reformat the code.


1 Answers

Go to View | Tool Windows | Version Control - Local Changes tab- Right click the text "Default" - Commit Changes (or Arrow icon on the left hand sided toolbar inside Local Changes tab). Find Before Commit section.

enter image description here

and un-tick Rearrange code.

Refer this for more.

like image 113
Supun Wijerathne Avatar answered Sep 20 '22 10:09

Supun Wijerathne