Why "Show history" and "Show history for Selection" options are in grey using Git with Intellij Idea 13?
Asked Answered
W

7

12

Go to some code file in Idea 13. Right click on it. Why "Git->Show history" and "Git->Show history for Selection" options are in grey using Git with Intellij Idea 13?

Willdon answered 6/3, 2014 at 18:7 Comment(0)
Q
3

One reason is that file is not under control of Git or just staged for the next commit.

EDIT

According to the source code, IDEA also does not enable Show History options for files which are detected as binary files, files not in local file system (I actually do not quite realize what does it mean), files with the class extention, "workspace files" (path/to/project/project.iws - for file-based projects; path/to/project/.idea/workspace.xml - for directory-based ones) and files from the "ignore" list (IDE Settings -> FileTypes -> "Ignore files and folders" textbox)

Quadratic answered 7/3, 2014 at 7:47 Comment(3)
No, file is under Git control. All files in the repository are having the same issue.Willdon
I simply added my file extension to the registered File Types. Even though it wasn't in the ignored list, it still didn't show it's history, until I registered it.Immortal
In my case local history was disabled for some files only. Comment by @Immortal helped.Minnick
V
36

From settings->Version Control edit the "Directory" entry in the table on the right pane and replace "project" with your project root path. You should now be able to show the history of files.

(This is of course a workaround, I'm not sure what IntelliJ considers to be the "project" directory)

Vanquish answered 14/10, 2016 at 7:50 Comment(3)
The bug for this at youtrack.jetbrains.com/issue/IDEA-123332#comment=27-711823 is still openDecameter
Still happens on community edition 2017.3.2. lyaffe, thanks for the workaround.Diverting
Thank you it works, the issue is still present in 2018.2.2Ronnie
Q
3

One reason is that file is not under control of Git or just staged for the next commit.

EDIT

According to the source code, IDEA also does not enable Show History options for files which are detected as binary files, files not in local file system (I actually do not quite realize what does it mean), files with the class extention, "workspace files" (path/to/project/project.iws - for file-based projects; path/to/project/.idea/workspace.xml - for directory-based ones) and files from the "ignore" list (IDE Settings -> FileTypes -> "Ignore files and folders" textbox)

Quadratic answered 7/3, 2014 at 7:47 Comment(3)
No, file is under Git control. All files in the repository are having the same issue.Willdon
I simply added my file extension to the registered File Types. Even though it wasn't in the ignored list, it still didn't show it's history, until I registered it.Immortal
In my case local history was disabled for some files only. Comment by @Immortal helped.Minnick
R
2

I have the same issue using IntelliJ IDEA 13.1.1 on Mac OS X 10.9.2 with git --version returning: git version 1.8.5.2 (Apple Git-48)

Right-clicking within a .java file and selecting "Git->Compare with..." correctly shows the previous versions, but "Show History" is greyed out.

When using IDEA version 10 on the same system, everything works.

I filed a bug report: http://youtrack.jetbrains.com/issue/IDEA-123332

Romaromagna answered 2/4, 2014 at 10:35 Comment(0)
H
2

I found I had two (git managed) projects. One had annotations etc. working. One did not - the annotations and "show history" menu items were greyed out.

What resolved the problem in the latter project was to

  • Open the File -> Settings menu,
  • Select the "Version Control" section (at the top level, not in the "Git" subsection)

Here the project was set to use the top level Git directory. This looked fine, and most of the other aspects of Git seemed to work through IntelliJ IDEA. However if I then:

  • Edited the directory entry (selecting, and clicking the pencil icon), and
  • Changed the radio selection from "Directory" to "Project", saving it

This allowed me then to access the git annotations menus etc.

The other project (which also worked with respect to annotations) had two entries, both a project entry, and a directory entry.

This was on Linux with:

IntelliJ IDEA 2016.1.3
Build #IC-145.1617, built on June 3, 2016
JRE: 1.8.0_76-release-b198 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Halogen answered 15/6, 2016 at 15:58 Comment(1)
This, eg changing the type from Directory to Project in the Edit VCS Directory Mapping dialog fixed the issue for me. Amazing that Intellij's support page for this problem does not mention this.Detainer
L
1

I had an issue like this. The project I imported into intellij had several modules that were added into VCS settings. I had to remove the modules and only leave the main project as the git root.

Lumpkin answered 14/1, 2015 at 16:3 Comment(0)
Q
1

I've had the same problem in IntelliJ 14.1 from time to time. Turned out it was due to using non-ASCII characters (e.g. æ, ø or å) in the branch name I was working on. I renamed the branch, and IntelliJ was able to diff again.

Quoit answered 26/3, 2015 at 11:17 Comment(0)
S
0

I had the same problem, it turned out I was using the git worktree feature which isn't supported on my version of Intellij -- see https://youtrack.jetbrains.com/issue/IDEA-143404.

Sixth answered 27/7, 2016 at 13:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.