Problem
On macOS, when using IntelliJ IDEA (or another IntelliJ‑based IDE) together with Git in a terminal, a “File cache conflict” / “File change conflict” dialog appears whenever a file that is open in the editor is modified by an external process (for example, git checkout, git pull, an external formatter, or a script).
This dialog is modal and focus‑stealing:
- It pops up on top of the IDE.
- It grabs keyboard focus, even if the user is currently working in a separate terminal window.
- As a result, the next command typed in the terminal can accidentally end up in the editor, causing unintended edits to the file.
User asked whether he can:
- Disable this dialog altogether, or
- Keep it from stealing focus while still detecting conflicts.
Cause
The File cache conflict dialog is only shown when both of the following are true:
- The file has unsaved changes in the IDE (the in‑memory version differs from what is on disk).
- An external process modifies the same file on disk (for example, Git, a file watcher, a formatter, antivirus, or a sync client).
In this situation, the IDE detects two conflicting versions of the file (cache vs. file system) and must ask which version to keep:
- Load FS Changes – take the external version and discard unsaved IDE changes.
- Keep Memory Changes – keep the IDE version and overwrite the on‑disk file.
- Show Difference – open a diff viewer to manually reconcile both versions.
Because this is a data‑loss‑sensitive decision, the conflict dialog is intentionally modal and focus‑stealing. There is no user‑visible option to:
- Completely disable conflict detection, or
- Make the conflict dialog non‑modal / non‑focus‑stealing.
The only reliable way to avoid it is to prevent real conflicts from occurring.
Recommended workaround: auto‑save when switching to terminal
The practical way to stop the popup (and therefore the focus steal) in Git workflows is to ensure that all modified files are saved before Git or other tools touch them.
You can achieve this by letting the IDE auto‑save on app/terminal switch:
- Open Settings / Preferences:
- macOS: IntelliJ IDEA | Settings… (or Preferences…)
- Windows/Linux: File | Settings…
- Go to Appearance & Behavior | System Settings.
- Under Sync external changes, enable:
- Save files when switching to a different application or a built‑in terminal
- Click Apply and OK.
With this option enabled:
- As soon as you switch from the IDE to your external terminal (or to the built‑in Terminal tool window), all modified files are saved.
- When you then run
git checkout,git pull, etc., Git updates files that are already fully saved; there is no mismatch between the IDE cache and disk, so no “File cache conflict” dialog is needed, and it does not appear.
Effectively, this removes the focus‑stealing pop-up for the most common scenario: editing in the IDE → switching to terminal → running Git commands.
Additional checks (optional)
If the conflict dialog still appears regularly, even with the above option enabled, check for other tools that may be rewriting files “behind your back”:
-
File Watchers / external formatters
- Go to Settings | Tools | File Watchers.
- Temporarily disable watchers or configure them to run only on explicit save, not continuously on every keystroke.
-
Antivirus/backup/sync tools
- Avoid keeping the project under OneDrive, Dropbox, iCloud, network shares, or SMB mounts when possible, as these can touch file timestamps or contents and trigger conflicts.
- Whitelist the project directory in antivirus or real‑time backup tools so they do not constantly rewrite files.
-
Third‑party plugins
- Some plugins can perform automatic saves or file rewrites (for example, “save actions” plugins or custom formatters).
- Temporarily disable them to confirm whether they are contributing to frequent conflicts.
Comments
0 comments
Please sign in to leave a comment.