'Clicking "Annotate" in intellij gives warning "number of lines annotated by git is not equal to number of lines"

When I try to see the side menu upon clicking "show annotate" this message appears only on this file. Other than that annotations work for all other files.

number of lines annotated by git is not equal to number of lines in the file. Check file encoding and line separators

This problem occurs in Intellij. And in my case in Android Studio



Solution 1:[1]

I know it isn't the solution but I wasn't able find out the root of the problem but I share what I did to get it working.

This happened to me after I hibernated my win 11 (WSL2 and docker) and the next day I tried to work.

After I restarted phpStorm it said, git was not even installed.

I did

  • git reset hard and clean,
  • reopened the project inside phpStorm, (after this it was still broken)
  • restarted the computer

after all of this it started to work again.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pszaba