Articles
Published · November 18, 2026

Case-Sensitive File Names on Mac: Why Git Sees Two Files

By default a Mac treats AFile.txt and afile.txt as the same name, but Git tracks them as two files. That mismatch is why one of them shows as modified.

Also in: Español中文हिन्दी

Quick answer

By default, a Mac treats AFile.txt and afile.txt as the same name, while Git treats them as two different files. A repository can hold both, but the disk can hold only one, so Git sees the other as modified. Remove one of them from the repository and the problem goes away.

How a Mac treats names: case-insensitive but case-preserving

Apple's file system guide says APFS is available in case-sensitive and case-insensitive variants on macOS, with case-insensitive being the default. The same guide says APFS preserves the case of a name on disk in all variants. So if you save Notes.md, the Finder and Terminal show Notes.md, but asking for notes.md finds the same file.

Windows does the same. The Git FAQ notes that Windows and macOS by default both perform case folding on file names, which is why a project that works on a Linux build server can behave oddly on your laptop.

Why Git shows one of the files as modified

Git does no case folding. It stores file names as sequences of bytes, so AFile.txt and afile.txt are two separate entries. Someone on Linux can commit both without any warning.

When you check that repository out on a Mac, the file system can store only one of them. According to the Git FAQ, when Git reads the other file to see its contents, it looks modified. You never touched it. git status lists it anyway.

If the diff output itself looks strange, it helps to know how to read a unified diff: you may see changes that are really the contents of the other file.

What core.ignoreCase does

Git has a setting for this situation. Its documentation describes core.ignoreCase as an internal variable that enables workarounds so Git works better on file systems that are not case sensitive, naming APFS, HFS+, FAT and NTFS. For example, if a directory listing finds makefile when Git expects Makefile, Git assumes it is the same file and keeps remembering it as Makefile.

The default is false, but git init and git clone probe the file system and set it to true when appropriate while creating the repository. You can see the value with:

git config core.ignoreCase

The documentation adds a warning: Git relies on this variable matching your operating system and file system, and modifying it may result in unexpected behavior. Don't flip it just to silence a status message. It describes your disk. It doesn't repair the repository. If you are unsure which file the setting lives in, see where Git settings live.

Fix a collision with git rm --cached

The Git FAQ's advice is to remove one of the files so only one remains. With AFile.txt and afile.txt on an otherwise clean working tree:

git rm --cached AFile.txt
git commit -m 'Remove files conflicting in case'
git checkout .

The first command removes the entry from Git's index without touching the file on disk. The commit records the removal. The last command restores the working tree from the index. In the FAQ's words, this avoids touching the disk but removes the additional file.

Before you run it, make sure you're keeping the version of the content you want. Compare both files on a machine where both exist, such as the original contributor's checkout.

The case-sensitive APFS option

If you really need two names that differ only by case, a Mac can do it on a different volume. Apple's Disk Utility lists APFS (Case-sensitive) and APFS (Case-sensitive, Encrypted) next to the standard formats, and gives the example that folders named "Homework" and "HOMEWORK" are two different folders. The format is chosen per volume, when you create it.

There's a trade-off. Some apps and tools assume the default behavior, so a case-sensitive volume can create surprises of its own. For most notes and code folders, a single naming convention is simpler.

Name files so it can't happen again

The Git FAQ suggests that a project may adopt a naming convention, such as all-lowercase names, and check it with a pre-receive hook or in continuous integration. Lowercase names with hyphens also avoid most of the characters to avoid in file names across Mac, Windows and Linux.

How Carets fits in

Carets is a fast, native notes and code editor for iPhone, iPad, and Mac. Your files stay plain text, so they remain portable, and they are organized into files, projects and tags. That makes it a handy place to open a README or a config file from a repository and decide which spelling of a name you want to keep before you run the fix. Syntax highlighting for code and config files makes those edits easier to read. Carets doesn't change how Git or your file system treats case, so the commands above still do the real work.

Get Carets on the App Store for iPhone, iPad, and Mac.

Frequently Asked Questions

Is a Mac file system case-sensitive?

By default, no. APFS on macOS comes in case-sensitive and case-insensitive variants, and case-insensitive is the default. It still keeps the capitalization you typed, so Notes.md stays Notes.md on disk.

Should I change core.ignoreCase to fix it?

No. Git sets it when a repository is created, relies on it matching your file system, and warns that changing it may cause unexpected behavior. Remove the extra file instead.

Can I make a Mac volume case-sensitive?

Yes. Disk Utility offers APFS (Case-sensitive) formats, where Homework and HOMEWORK are different folders. That is a volume format chosen when you create the volume, not a Git setting.