Intellij Annotate Option Grayed Out

后端 未结 11 1188
谎友^
谎友^ 2021-02-05 00:48

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 numb

相关标签:
11条回答
  • 2021-02-05 00:55

    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).

    0 讨论(0)
  • 2021-02-05 00:55

    I had the same issue with the Annotate being greyed out however VCS was already set up. Editing the current VCS Directory Mapping fixed the issue for me.

    Go to

    • Settings -> Version Control
    • Click on the current entry for your your application listed under projects.
    • Click the pen icon to edit it
    • Hit Ok, then ok to close the main dialog
    0 讨论(0)
  • 2021-02-05 00:58

    I had the same issue, but my VCS settings were all configured properly. It turns out that git itself was considering the file as a brand new file and therefore didn't have any history for it. The file was actually not new, but simply renamed. While my rename changes were unstaged, git understood it as two separate files: a deletion of the old file and creation of a new file. However, once I git added the "deleted" file and the "new" file, git understood that it was actually a rename and IntelliJ was able to annotate on the file as expected.

    I'm not sure why git didn't understand the rename when it was unstaged, but hopefully this helps someone!

    0 讨论(0)
  • 2021-02-05 00:59

    Looks like its a fresh project. First configure the Version Control like Git and than commit at least once. After first commit Annotate option will not be grayed out.

    Also update git for any new version.

    0 讨论(0)
  • 2021-02-05 01:00

    I had exactly the same issue and managed to solve it by updating git. The reason for that is that I have recent InteliJ Idea and an old 2.1.x git installed.

    For Mac:

    brew upgrade git
    brew link git
    

    followed by IDE restart.

    0 讨论(0)
  • 2021-02-05 01:03

    Here are the steps i followed : Go to VCS -> Checkout from Version Control -> Git -> give the URL for your repository.

    The annotate option will be enabled now.

    0 讨论(0)
提交回复
热议问题