59

How to display "git blame" after opening a file by default in PhpStorm.

Without "right-click the left gutter, and select the Annotate option", I want to display "git blame" by default after just opening files.

Emile Bergeron
  • 17,074
  • 5
  • 83
  • 129
NH_j
  • 629
  • 1
  • 6
  • 5

4 Answers4

79

'git blame' is supported - the command is called annotate in PhpStorm.

  1. Right-click the file
  2. Choose Git > Annotate

Annotate option in the context menu

Annotate result in the file

Emile Bergeron
  • 17,074
  • 5
  • 83
  • 129
lena
  • 90,154
  • 11
  • 145
  • 150
  • 12
    Thanks for your advice. But I know it. Without "right-click the left gutter, and select the Annotate option", I want to display "git blame" by default after just opening files. – NH_j Dec 22 '14 at 01:51
  • 2
    why `Annotate` feature is disabled, even if repo is under `Git`? – hellboy Nov 03 '16 at 08:51
  • 4
    You doesn't seem to answer the question that was asked! – Kalmar Aug 13 '18 at 11:46
  • 1
    @Kalmar But almost anyone coming here simply wants to view git blame; as this question is the first result for the query "View git blame phpstorm" in google – HosseyNJF Apr 03 '20 at 23:15
11

You can set a hotkey for almost anything in PHPStorm.

Click Preferences > Keymap. Search for Annotate. You can then set a hotkey to toggle Annotations in PHPStorm.

This doesn't exactly solve the problem of showing annotations when a file is opened but does eliminate the need for lots of fiddly clicking.

Jimmy Bob
  • 113
  • 1
  • 5
  • 1
    In recent versions of Intellij's IDEs the option is listed as `Git Blame` instead of `Annotate`. Search for that instead. – mutableVoid Jun 07 '21 at 15:34
8

It is possible with the GitToolbox plugin.
These settings are enabled by default i think and it also displays the blame in the status bar.

If you want to edit the settings, you go to File-> Settings-> Version Control -> GitToolbox and you can see the checkbox 'Show editor inline 'Blame''.

tpliakas
  • 1,118
  • 1
  • 9
  • 16
2

It's not exactly an solution, but can help if you're tired of creating new shortcuts for every little functionality that you need.

You right click the file, press G, release, and press N

it's the same as pointing to the GIT, waiting for the window to popup and selecting the annotate function, only faster.

That's the way I do.

Hope it helps somebody

rt3norio
  • 45
  • 6