My company has a policy about keeping source code in encrypted storage when on local developer machines. Where does IntelliJ IDEA keep the copy of the code changes that is used to drive its local history feature?
(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:
%LOCALAPPDATA%\JetBrains\<product><version>
C:\Users\Snoopy\AppData\Local\JetBrains\IntelliJIdea2020.1
~/Library/Caches/JetBrains/<product><version>
~/Library/Caches/JetBrains/IntelliJIdea2020.1
~/.cache/JetBrains/<product><version>
~/.cache/JetBrains/IntelliJIdea2022.1
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.)