Interview Prep/Git & GitHub/Config, Line Endings, Files and Platform Quirks

Clone prints `warning: the following paths have collided (e.g. case-sensitive paths on a case-insensitive filesystem) and only one from the same colliding group is in the working tree:`

IntermediateTroubleshootingConfig, Line Endings, Files and Platform Quirks
Answer

Likely causes → The repo contains two paths that differ only by case (e.g. src/Utils.js and src/utils.js), created on Linux. On macOS/Windows only one can exist, so git status constantly shows one of them as modified.

Diagnose → git ls-files | sort -f | uniq -di

Fix → Decide which one is correct and remove the other in the repo (from any machine, using the index only):

git rm --cached src/Utils.js
git commit -m "Remove duplicate Utils.js (case collision)"
git push

Merge the content first if both files differ.

Prevent → Add a CI check for case-insensitive duplicates (the check-case-conflict hook in pre-commit does this).

All Git & GitHub questions Roadmap: Git & GitHub

More on Config, Line Endings, Files and Platform Quirks