Windows .gitignore Template

The full, current Windows .gitignore template — copy it as-is, or head to the .gitignore Generator to merge it with other stacks into one file.

Template

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

What each entry does

Why every line in this template is excluded, not just what it matches.

Entry Why it's excluded
Thumbs.db Windows Explorer's thumbnail cache for a folder — OS-generated, no project value.
Thumbs.db:encryptable Files matching Thumbs.db:encryptable — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
ehthumbs.db A Windows thumbnail cache variant (network drives) — OS clutter, same as Thumbs.db.
ehthumbs_vista.db Files matching ehthumbs_vista.db — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.stackdump Files matching *.stackdump — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
[Dd]esktop.ini Windows folder-customization metadata — OS-generated clutter.
$RECYCLE.BIN/ A generated/local directory ($RECYCLE.BIN) — excluded because its contents are either build output or machine-specific state, not source you'd want to review in a diff.
*.cab Files matching *.cab — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.msi Files matching *.msi — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.msix Files matching *.msix — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.msm Files matching *.msm — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.msp Files matching *.msp — a generated or machine-specific file type for this stack, safe to regenerate rather than track.
*.lnk Files matching *.lnk — a generated or machine-specific file type for this stack, safe to regenerate rather than track.