Reputation: 6647
I am working on a Java project in Intellij that uses git. Quite a few files are blue (to show that changes have been made), however when I right click them and click on "Git -> Compare with Latest Repository Version" it says that the contents are identical. Anyone know why this happens? It only seems to happen to files that I've opened to look at but haven't changed. Could it happen if I accidentally added extra white space and then deleted it or something? Or just extra whitespace in general?
Upvotes: 5
Views: 4375
Reputation: 59
This happens when there is dubious ownership detected in your repository. I had this issue in Intellij 2023.3.4 Community Edition. To solve this go to Settings->Version Control->Directory Mappings and remove the directory with dubious ownership file.
Upvotes: 1
Reputation: 3943
This is how GIT is different from SVN. GIT's change detection algorithm does not depend only on the content of the file but the meta data (timestamp last modified, etc) of the file as well. So even if you are adding just one space and removing it later on; if you save it, it modifies the metadata of the file.
For more details, you can have a look at: What algorithm does git use to detect changes on your working tree?
Upvotes: 3