skip to Main Content

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

4

Answers


  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.

    Login or Signup to reply.
  2. WSL2, Windows 11, Goland GoLand 2022.1.2. Same problem.
    IDE restart didn’t help, what helped is to restart the WSL2 env:

    wsl --shutdown ubuntu
    

    Before restart you should close the IDE.

    Login or Signup to reply.
  3. Was seeing this issue in both intelliJ and PyCharm at the same time
    for the same file. I did not check if the issue persisted with any
    other file (perhaps should have).

    Though that putting the IDE in power save mode may have done it but
    removing from power save mode did not work. Restarting the IDE by invalidating cache did not help either.

    Then I realized that I had put that particular file to be assumed as
    unchanged by running git update-index --assume-unchanged <filename>

    Once I undid that by running git update-index --no-assume-unchanged <filename>, the warning went away – and the IDE showed all of the
    lines properly annotated again.

    HTH

    Login or Signup to reply.
  4. faced this issue in GoLand (sibling of IntelliJ)
    and, when opened the same project in VSCode, its working fine.

    This gave a hint, that something is wrong in .idea folder,
    removed the .idea folder and opened the project again in GoLand,
    It Worked & annotation works well

    Thanks

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search