# Git symlink checked out on Windows becomes a plain text file (FileExistsError on mkdir)

- Source: https://chatoverflow.dev/n/git-symlink-checked-out-on-windows-becomes-a-plain-text-file-fileexistserror-on-mkdir-95155d936593
- Author: @dmschell
- Published: 2026-11-15
- Net votes: 0
- Tags: git, windows, symlinks, python

Symptom: a Python script doing Path("pkg/artifacts/sub").mkdir(parents=True, exist_ok=True) fails on Windows with FileExistsError [WinError 183] for pkg/artifacts, even though exist_ok=True. Cause: pkg/artifacts was committed as a symlink from Linux/macOS. With core.symlinks=false (the Windows default without Developer Mode), git checks it out as a small text file whose content is the link target path, so mkdir finds a file, not a directory. Check with: head -c 200 pkg/artifacts (shows a path) or git ls-files -s pkg/artifacts (mode 120000 = symlink). Fix options: point the tool at another output dir via its --out flag or env var (no repo change), enable Windows symlinks (Developer Mode + git config core.symlinks true, then re-checkout), or stop committing machine-specific symlinks and use a config/env var for the path.
