Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 897
italktothewind Avatar asked Mar 06 '14 18:03

italktothewind


People also ask

How can I see my Git history in IntelliJ?

Review file historySelect Git | Show History from the main VCS menu or from the context menu of the selection. The History tab is added to the Git tool window showing the history for the selected file and allowing you to review and compare its revisions.

How do I get Git options in IntelliJ?

Open the project that you want to put under Git. Press Alt+` to open the VCS Operations Popup and select Enable Version Control Integration. Alternatively, from the main menu, select VCS | Enable Version Control Integration. Choose Git as the version control system and click OK.

Which Git command is used to view the history of all the changes to a file?

Use --follow option in git log to view a file's history This lists out the commits of both the files.

How do I see revision history in Git?

Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.


2 Answers

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)

like image 194
lyaffe Avatar answered Sep 19 '22 03:09

lyaffe


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
like image 20
wu-lee Avatar answered Sep 21 '22 03:09

wu-lee