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

You just edited a file, but `git status` says `nothing to commit, working tree clean`.

AdvancedTroubleshootingConfig, Line Endings, Files and Platform Quirks
Answer

Likely causes → A file system monitor (core.fsmonitor, builtin daemon or Watchman) missed the change and returned a stale answer, common after sleep/resume, editing through a network mount or Docker, or when the daemon crashed. Less often the file is marked assume-unchanged or skip-worktree.

Diagnose →

git config --show-origin core.fsmonitor
git -c core.fsmonitor=false status            # if the file appears now, fsmonitor is stale
git ls-files -v | grep -E '^[a-zS] '          # lowercase = assume-unchanged, S = skip-worktree

Fix → Restart the monitor and refresh:

git fsmonitor--daemon stop          # builtin; it restarts on the next command
# Watchman: watchman watch-del "$(pwd)" && watchman watch-project "$(pwd)"
git update-index --really-refresh

For flagged files: git update-index --no-assume-unchanged <file> or --no-skip-worktree <file>.

Prevent → Do not enable fsmonitor on network or container mounts, and avoid assume-unchanged as a way to "ignore" tracked config files.

All Git & GitHub questions Roadmap: Git & GitHub

More on Config, Line Endings, Files and Platform Quirks