Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does IntelliJ IDEA keep local history files?

My company has a policy about keeping source code encrypted on local developer machines. Where does IntelliJ IDEA keep the copy of the code changes that is used to drive its local history feature?

like image 957
rakslice Avatar asked Mar 21 '14 19:03

rakslice


People also ask

Where is IntelliJ Local History stored?

With IntelliJ IDEA you can restore that change in a couple of clicks. Right-click anywhere in the editor and choose Local History | Show History from the context menu. In the dialog that opens, the left-hand pane shows a list of all saved revisions of the current file with timestamps.

How do I clear Local History in IntelliJ?

From the main menu, select File | Invalidate Caches. In the Invalidate Caches dialog, you can select additional actions that the IDE will perform while removing the cache files: Clear file system cache and Local History: remove the virtual file system cache together with the information stored in Local History.

Where are IntelliJ IDEA projects stored?

Project settings are stored in the project directory as a set of XML files under the . idea folder.

How do I show local changes in IntelliJ?

Local changes tab ( View | Tool Windows | Version Control - Local Changes ), default shortcut is Alt + 9 .


3 Answers

Local history file location:

(Answer updated to show new locations as they changed in v2020.1)

They are stored in ${idea.system.path}/LocalHistory/. See the Directories used by the IDE page in the user guide (and this legacy IDEA document) for the location of the IntelliJ IDEA idea.system.path directory on various platforms. The default locations changed in 2020.1. See the above guide for info if using an older version. Also note the locations can change based on overrides you may have made.

The defaults for the system directory for 2020.1 and later are:

  • Windows:
    • %LOCALAPPDATA%\JetBrains\<product><version>
    • Example: C:\Users\Snoopy\AppData\Local\JetBrains\IntelliJIdea2020.1
  • Mac:
    • ~/Library/Caches/JetBrains/<product><version>
    • Example: ~/Library/Caches/JetBrains/IntelliJIdea2020.1
  • Linux:
    • ~/.cache/JetBrains/<product><version>
    • Example: ~/.cache/JetBrains/IntelliJIdea2022.1

Turning off local history

As a side note, if you want to turn local history off, you can do so in the maintenance registry. On Windows/Linux, you can access it via Ctrl+Alt+Shift+/, or Cmd+Opt+Shift+/ on Mac. Select "Registry" from the popup. In the registry dialog, find the entry localHistory.daysToKeep and set it to zero. (I've never actually tried setting it to zero, but I am assuming it would work for you.)

like image 157
Javaru Avatar answered Oct 09 '22 06:10

Javaru


After the information provided by Javaru. For example, PyCharm saves the Local History at:

~/Library/Caches/PyCharm2017.1/LocalHistory

More information: Project and IDE Settings, Directories used by the IDE to store settings, caches, plugins and logs

like image 4
juanbretti Avatar answered Oct 09 '22 06:10

juanbretti


On my Windows machine, local history is kept in this folder:

C:\Users\hp\AppData\Local\JetBrains\IntelliJIdea2020.3\LocalHistory
like image 2
lmllmllml Avatar answered Oct 09 '22 08:10

lmllmllml