Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable git annotations in PhpStorm

This is a silly problem, but I can't for the life of me figure out how to enable git annotations within PhpStorm. Normally you can just right click the line number gutter and select Annotate which displays information about who committed that code, when it was committed, and links to the commit on github. However, when I right click, the Annotate button is gray and not clickable.

Gray annotate button

I do have both git and github set up within my PhpStorm preferences:

git setupgithub setup

There's probably another setting in there somewhere, but I've been looking and I can't find it.

Anybody know how to get those git annotations working?

like image 872
johncorser Avatar asked Jul 27 '16 16:07

johncorser


People also ask

What is annotate with git blame?

The high-level function of git blame is the display of author metadata attached to specific committed lines in a file. This is used to examine specific points of a file's history and get context as to who the last author was that modified the line.

Why annotate is disabled in IntelliJ?

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.

How do I blame in git?

The git blame command is used to examine the contents of a file line by line and see when each line was last modified and who the author of the modifications was. If there was a bug in code,use it to identify who cased it,then you can blame him. Git blame is get blame(d).


1 Answers

Version Control Integration:

  1. Click on VCS in Menu Bar
  2. Click Enable Version Control Integration...

enter image description here

  1. Select Git from Drop-down and then press OK Button.

enter image description here

Remove Version Control Integration:

  1. Go to the Settings (Alt+Ctrl+S in windows).
  2. At Version Control you can remove Integrated VCS.

enter image description here

like image 167
Ali Motameni Avatar answered Dec 24 '22 23:12

Ali Motameni