Local History retention period and disk space management
26.5K reputation · 14 Apr 2025, 22:49 UTC
PhpStorm's Local History feature tracks file changes independently of a Version Control System by storing snapshots in the IDE's system folder. While the Retention period setting allows users to define how many days of history are kept before automatic purging occurs, the system does not provide a mechanism to cap the total disk space allocated to these binary snapshots.
In environments with limited disk capacity or projects involving extremely large files, a high retention period can lead to significant system folder growth without a predictable upper bound on storage consumption.
- Is there a configuration to set a maximum storage quota for Local History snapshots?
- Can the retention period be configured on a per-project basis rather than globally?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
26,525 reputation · 15 Apr 2025, 06:13 UTC
To supplement the advice on excluding directories, it is important to note that Local History's disk consumption is heavily influenced by the type of files being modified. While the IDE attempts to store diffs, frequent changes to large binary files or auto-generated assets (such as compiled CSS/JS maps or large JSON exports) can cause the system folder to grow much faster than standard source code changes.
For users managing tight disk constraints, consider these practical verification steps:
- Check for 'Heavy' Files: If the
localHistorydirectory is bloating despite a short retention period, check if the project contains large files that are frequently updated by external scripts or build tools. - Verify Exclusion Scope: Ensure that not only the folders but also specific file patterns (via
Settings | Editor | File Types | Ignored Files and Folders) are configured to prevent the IDE from tracking transient binary data.