IntelliJ automatically updating a file every time I rollback the automatic updates to the file
Answered
IntelliJ keeps changing one file in my project. Every time I rollback the changes, it immediately makes the same changes again. This prevents me from using a lot of Git features, because my local directory is never in sync with the branch, because every time it is in sync, IntelliJ changes this file to not by in sync with the branch.
I don't know how else to explain it. Just watch. https://youtu.be/Mg2ncuttzh4
I'm not going to commit IntelliJ's changes; I don't like them.
How do I make IntelliJ stop changing this file?
Please sign in to leave a comment.
Please check below:
1. Open `File | Settings | Tools | Actions on Save`, and check no "Reformat code", "Optimize imports" or some options are enabled that make change to your file.
2. Please check the difference in the Git commit. if there are some spaces removed in the file causing this change, please check `File | Settings | Editor | General On Save | Remove trailing spaces on` option and disable it. if you used editorconfig (https://editorconfig.org/) in your project, make sure you don't have `trim_trailing_whitespace` configured in your .editorconfig file.
If none of the above helps, could you please share more details about what changes happen (e.g., some indentation changes, spaces removed, or something else)?
This will help us identify which feature may be triggering this.