Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij Annotate Option Grayed Out

I am trying to look at who changed a line in Intellij 15. I know I can use git blame but I want to learn how to do it correctly in intellij. I am right clicking on the line numbers on the file but when I get the context menu the annotate option is grayed out. What setting am I missing?

I looked at this page and couldn't find an answer. What am I missing?

like image 921
ford prefect Avatar asked Feb 04 '16 16:02

ford prefect


People also ask

How do I Annotate in IntelliJ?

You can also annotate a particular file from the file history view. In the History tab, select the file version you want to review, right-click the corresponding line and select Annotate from the context menu.

How do I see git blame in IntelliJ?

Right-click the gutter in the editor or in the Differences Viewer and select Annotate with Git Blame from the context menu. You can assign a custom shortcut to the Annotate command: go to the Keymap page of the IDE settings Ctrl+Alt+S and look for Version Control Systems | Git | Annotate.

Who wrote the code in Android Studio?

You can install GitToolBox plugin to view code blame on every cursor position. you can view by right clicking on left gutter in android studio, you will have a pop-up with option for Annotation or Annotate with Git Blame.


2 Answers

If you check File > Settings > Version Control and see that your current project is listed under "Unregistered Roots", go to (on the menubar) VCS > Enable Version Control Integration. It will ask you to select the VCS tool you use, then click ok and you'll have all the integrations working (including the annotate feature which uses git blame).

like image 56
Jason Howell Avatar answered Sep 25 '22 20:09

Jason Howell


The answer by @activedecay let me in the right direction. In my case, I have a multi-module project - each has a separate git repo - but we're all in the same workspace.

In my case, Intellij IDEA 2017.2, the Preferences -> Version Control panel shows a listing of all the project roots. The module with the disabled "Annotate" option was in the "Unregistered Roots" section.

To fix the problem, I selected the module and pressed the "+" icon in the lower toolbar to register the module root with Intellij VCS. The change is immediate and the "Annotate" options becomes available.

like image 32
Mark D Avatar answered Sep 22 '22 20:09

Mark D