Inside a dev container with a bind-mounted repo, `git status` lists every file as modified, while Git on the Windows/macOS host says the tree is clean.
AdvancedTroubleshootingConfig, Line Endings, Files and Platform Quirks
Answer
Likely causes → Two different Git installations share one working tree with different settings: the host checked files out with CRLF (core.autocrlf=true) but container Git has no autocrlf; or the mount reports all files as 0755, so container Git sees mode changes. Stat data (inode, uid, ctime) also differs between host and container, forcing rehashing and making status slow.
Diagnose →
git diff --stat | tail -1
git diff --summary | grep -c 'mode change'
git config --show-origin core.autocrlf; git config core.fileMode
Fix → Align the configs in the container for this repo:
git config core.fileMode false
git config core.autocrlf true # match the host if it checked out CRLF
git config core.trustctime false
git update-index --refresh
Better: commit a .gitattributes with explicit eol rules so autocrlf no longer matters.
Prevent → Clone the repo inside the container volume (VS Code "Clone Repository in Container Volume") instead of sharing a host checkout between two Gits.
More on Config, Line Endings, Files and Platform Quirks
`warning: in the working copy of 'app.sh', LF will be replaced by CRLF the next time Git touches it`Beginner`git diff` shows `old mode 100755` / `new mode 100644` for hundreds of files with no content change.BeginnerCloning on Windows fails with `error: unable to create file src/very/deep/.../component.test.ts: Filename too long`.BeginnerYou renamed `header.tsx` to `Header.tsx` on macOS. Locally everything builds, but Linux CI fails with `Module not found: Can't resolve './components/Header'`.IntermediateCheckout on Windows fails with `error: invalid path 'logs/2024-01-01T10:00:00.log'` (or `'docs/aux.md'`) and `fatal: unable to checkout working tree`.IntermediateClone 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:`Intermediate