github/gitignore · Global/Windows.gitignore

Windows .gitignore Template Explained

Why Windows.gitignore ignores Thumbs.db, desktop.ini, $RECYCLE.BIN, installer packages and shortcut files, with notes on case sensitivity and global settings.

Open in generator Open with VisualStudio, Dotnet, VisualStudioCode

Windows.gitignore blocks the files Windows Explorer and the shell create in folders, plus installer package formats. At about 13 lines it is short and, like the macOS template, well suited to a personal global gitignore.

The Windows file system is case-insensitive, but git compares patterns case-sensitively by default. That is why some rules list both spellings, as in [Dd]esktop.ini.

Rules explained

PatternWhat it ignores and why
Thumbs.dbThumbs.db:encryptableehthumbs.dbehthumbs_vista.dbThumbnail cachesThumbnail caches Explorer used to create in image folders. Since Vista a central cache is used, but they still appear on network drives or with old settings.
[Dd]esktop.iniFolder settingsA hidden system file that holds customizations such as the folder icon and display name.
$RECYCLE.BIN/Recycle BinThe Recycle Bin folder created at the root of removable drives or volumes. It is caught when a repository is created at the root of a drive.
*.cab*.msi*.msix*.msm*.mspInstaller packagesWindows Installer packages, merge modules, patches and cabinet archives. Treat them as build output or distribution files.
*.lnk*.stackdumpShortcuts and dumpsPersonal shortcut files and dumps left when Cygwin or MSYS programs terminate abnormally.

Practical notes

Original template

Windows.gitignore13 rules
# Windows thumbnail cache filesThumbs.dbThumbs.db:encryptableehthumbs.dbehthumbs_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

Templates from github/gitignore/Global/Windows.gitignore @356fd7b (2026-09-11) · CC0-1.0

Often used together

More template explanations