Have you ever opened a Maven project in IntelliJ IDEA on your Mac only to find every single file marked as “Modified” or “New,” even though you haven’t touched a line of code?
This is a common headache for developers moving between Windows and macOS environments. The culprit isn’t your code. It’s how different operating systems handle the invisible characters at the end of every line.
Table of Contents
The Problem: CRLF vs. LF
Windows uses CRLF (Carriage Return + Line Feed) to end lines, while macOS and Linux use LF (Line Feed). When you clone a project created on Windows onto your Mac, Git may detect these line-ending differences as actual file changes. This results in IntelliJ showing blue (modified) or green (new) status for files that should be clean.
The Quick Fix: core.autocrlf input
The most effective way to resolve this globally on your Mac is to tell Git to normalize these line endings automatically.
Step-by-Step Solution
- Open your Terminal.
- Run the following command:
git config --global core.autocrlf input
This tells Git to convert CRLF to LF when you commit code, but to keep things as-is when you check them out on your Mac.
- Refresh IntelliJ IDEA.
Once the config is set, your file status colors should return to normal. If they don’t immediately change, try running git status in your terminal to force a refresh.
Secondary Fix: Registering Directory Mappings
If the files still show “not in git” or “unregistered,” you may need to tell IntelliJ where your Git root is.
- Go to Settings (⌘ + ,) > Version Control > Directory Mappings.
- If you see an “Unregistered root” at the bottom, click the + icon to add it.
- Ensure the VCS column is set to Git.

Pro-Tip: Use .gitattributes
To prevent this issue for everyone on your team (regardless of their OS), add a .gitattributes file to your project root with the following line:
* text=auto
This ensures Git handles line endings consistently across all developer machines.