.gitignore for Windows
13 ignore rules for Windows, ready to copy into your repository.
Microsoft Windows operating system
The complete .gitignore for Windows
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2025-11-21 09:00:45 UTC
# Technologies: Windows
### Windows ###
# Windows thumbnail cache
Thumbs.db
# Windows encrypted thumbnail cache
Thumbs.db:encryptable
# Windows enhanced thumbnail cache
ehthumbs.db
# Windows Vista thumbnail cache
ehthumbs_vista.db
# Windows crash dump
*.stackdump
# Windows folder configuration
[Dd]esktop.ini
# Windows recycle bin
$RECYCLE.BIN/
# Windows cabinet archive
*.cab
# Windows installer package
*.msi
# Windows app package
*.msix
# Windows merge module
*.msm
# Windows patch file
*.msp
# Windows shortcut
*.lnk
What these Windows rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Windows thumbnail cache files
| Pattern | What it ignores |
|---|---|
Thumbs.db |
Windows thumbnail cache |
Thumbs.db:encryptable |
Windows encrypted thumbnail cache |
ehthumbs.db |
Windows enhanced thumbnail cache |
ehthumbs_vista.db |
Windows Vista thumbnail cache |
Dump file
| Pattern | What it ignores |
|---|---|
*.stackdump |
Windows crash dump |
Folder config file
| Pattern | What it ignores |
|---|---|
[Dd]esktop.ini |
Windows folder configuration |
Recycle Bin used on file shares
| Pattern | What it ignores |
|---|---|
$RECYCLE.BIN/ |
Windows recycle bin |
Windows Installer files
| Pattern | What it ignores |
|---|---|
*.cab |
Windows cabinet archive |
*.msi |
Windows installer package |
*.msix |
Windows app package |
*.msm |
Windows merge module |
*.msp |
Windows patch file |
Windows shortcuts
| Pattern | What it ignores |
|---|---|
*.lnk |
Windows shortcut |
How to use this .gitignore for Windows
- Copy the Windows rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.