Robert Oschler
Robert Oschler

Reputation: 14375

IntelliJ keeps reverting my changes?

I have a Gradle/Groovy project that I am using IntelliJ with:

IntelliJ IDEA 2017.2.1
Build #IU-172.3544.35, built on July 31, 2017
Subscription is active until April 3, 2018
JRE: 1.8.0_152-release-915-b6 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 3.13.0-128-generic

This issue just started when I tried editing a file that was in one of the folders marked as "Exclude" (dark orange folder icon). The problem never happens with files in one of the "Source" folders. While editing it, I get a "File Cache Conflict" and IntelliJ offers me the option to Reload/Ignore/View Diffs. If I make a change and switch away from the Tab with the source file, IntelliJ just reverts it silently and when I return to the Tab the file has gone back to the pre-edited state.

If it matters, the file I'm editing that has this problem is common.gradle in the Excluded "build" folder tree.

Why is this happening and how can I fix this?

Upvotes: 0

Views: 1764

Answers (1)

Enrico M. Crisostomo
Enrico M. Crisostomo

Reputation: 1703

Are you sure that the file is not being automatically generated? In that case it's not IntelliJ IDEA "reverting" your changes, but simply reloading the file because it detected changes that happened outside of its control (or as a side effect of an operation actually triggered by the IDE). The fact that IntelliJ IDEA is warning you that the file has changed indicates that it is not IntelliJ IDEA who's making those changes. And that would also be a good reason to keep that directory as excluded and not modify that file manually.

Upvotes: 2

Related Questions