문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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

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

C:\Users\hp\AppData\Local\JetBrains\IntelliJIdea2020.3\LocalHistory

On my Linux device, (Android Studio 4.1 RC 3 under Ubuntu 20.04.1), local history is kept in this folder.

/home/[user]/.cache/Google/AndroidStudio4.1/LocalHistory

With every new release of Android Studio, I have at some time or another attempted to flush all source code change history using Invalidate Caches / Restart but this has always failed.

After many years I have concluded that despite various assertions to the contrary, the only way to achieve this is to trash the LocalHistory folder along with its containees changes.storageData and changes.storageRecordIndex.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top