esin88
esin88

Reputation: 3199

VSC -> Git -> Annotate button is disabled

I have a git project in IDEA. And sometimes Git -> Annotate button becomes disabled. It was disabled almost all the time and enabled only when IDEA is just started, or project is just reindexed.

First I thought that it could be memory issues, but even after I set Xms and Xmx options to 8G in the idea.Vmoptions, Annotate was still disabled.

Do you have any ideas what can be the reason for such behavior? And how is it possible to fix it? Thank you!

p.s. Git setup for the project is correct. It's possible to commit/pull/push etc.

UPD these files are not ignored, they are not under git submodules, they are versioned `.java.' files

UPD2 IDEA logs are empty, and command-line git equivalent works fine for those files

UPD3 OK, after I click Refresh in Version Control tool window, Annotate button becomes active. But I do some changes - it becomes disabled again.

UPD4 Ok, the question can be summarized as: is there a way for IDEA to refresh my local changes automatically? Settings -> Version Control -> Background -> Refresh changes every... doesn't refresh local changes.

Upvotes: 1

Views: 3134

Answers (3)

joeaniu
joeaniu

Reputation: 369

Refreshing in Version Control tool window did't work for me. So I just created a new project, re-imported the module, then the annotate command was enabled both in the file gutter and in the menu.

Hope this helps.

Upvotes: 0

VonC
VonC

Reputation: 1323203

I confirm git annotate is active in IntelliJ (2016.2.4) for any versioned files (not folder or project itself)

You can also activate it through the file gutter

https://www.jetbrains.com/help/img/idea/annotateShow.png


For the files where Annotate is inactive, you can check if the command-line equivalent of Annotate does work.
See issue 161433:

git -c core.quotepath=false blame --porcelain -l -t -w %revision_hash% -- %file_name%

Check also the message view for any error, as in issue 160309


As commented by the OP esin88

The problem was that my whole project folder was ignored, but in Preferences | Version Control | Ignored Files, not in .gitignore.

Upvotes: 3

Apurv Nerlekar
Apurv Nerlekar

Reputation: 2320

Your VCS is not enabled, hence the issue. Below is the solution for that:

  1. Click on the VCS option in the menu bar
  2. Enable VCS
  3. Select your version control
  4. Done, you should be able to use the annotate option

Upvotes: 2

Related Questions