IntelliJ IDEA shows freshly checked-out files from GIT as changed while there is no difference

Like in the title, after checking out repository from GIT, the files are shown as changed (blue) by IntelliJ IDEA.

But they are not.

How to fix that?


Solution 1:

What causes the problem is probably one of those:

  1. line-ends converted / or not to CRLF (on the fly)
  2. changed file mode
  3. ignored / or not case

Here is why that may happen:

  1. IntelliJ IDEA is using a different Git than the one that was used to check-out the files

Check which Git is in the System Path and which is in Settings > Version Control > Git > Path to Git excutable.

  1. git --version may be useful too to check versions in different contexts

  2. Even if versions are the same, what makes the difference is the configuration

git config --list shows what parameters were set


In my case, the Git version was the same, but from two different paths (one came in the package, one was installed independently). The configuration was different (default vs adopted) and that was enough to make everything quite confusing.

Especially check:

core.autocrlf=true (mainly on Windows)
core.filemode=true
core.ignorecase=true