Problem
During a Git operation (commit, pull, sync), the IDE shows a warning that files will be overridden, but those files are not visible in the Commit tool window or the changes list.
Cause
The file is included in the IDE's Settings | Editor | File Types | Ignored Files and Folders list, but it is also tracked by the Git repository.
The IDE's "Ignored Files and Folders" setting is independent from .gitignore — it only hides files from the IDE's UI (Project view, Commit tool window, and so on). It does not stop Git from tracking the file. When such a file is modified by another tool (for example, a colleague using a different editor commits it, or it is updated by a build process), Git still reports it as a pending change, but the IDE does not display it in the changes list. This produces a Git warning that appears to reference files which "do not exist".
Resolution
Choose one of the two options depending on whether the file should remain in the repository.
Option 1: Keep the file tracked in Git
Remove the file from the IDE's ignore list so that it becomes visible in the Commit tool window:
- Open Settings (Ctrl+Alt+S on Windows/Linux, ⌘, on macOS).
- Navigate to Editor | File Types | Ignored Files and Folders.
- Select the file or pattern and remove it from the list.
- Click OK.
See Configure the list of ignored files and folders for details.
Option 2: Stop tracking the file in Git
Remove the file from the repository while keeping the local copy. This is appropriate when the file should not have been committed in the first place (for example, IDE settings, build artifacts, or local configuration):
-
Add the file pattern to
.gitignore. -
Untrack the file in Git:
git rm --cached <file> git add <file> git add .gitignore git commit -m "Stop tracking <file>" git push -
Notify other contributors to pull the change so the file is also removed from their local repositories.
Additional Information
- The IDE's "Ignored Files and Folders" list is a global IDE setting, not a per-project Git configuration. It is shared across all projects opened in the IDE.
- A related platform request to surface this conflict in the UI is tracked in IJPL-81859.
Comments
0 comments
Please sign in to leave a comment.