.gitignore for D
13 ignore rules for D, ready to copy into your repository.
Systems programming language
The complete .gitignore for D
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:28:16 UTC
# Technologies: D
### D ###
# Object file
*.o
# Object file
*.obj
.dub
# Shared object
*.so
docs.json
# macOS dynamic library
*.dylib
__dummy.html
# Dynamic link library
*.dll
docs/
*.lst
# Static library
*.a
# Library file
*.lib
# Windows executable
*.exe
What these D rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Compiled Object files
| Pattern | What it ignores |
|---|---|
*.o |
Object file |
*.obj |
Object file |
DUB
| Pattern | What it ignores |
|---|---|
.dub |
DUB |
docs.json |
DUB |
__dummy.html |
DUB |
docs/ |
DUB |
Compiled Dynamic libraries
| Pattern | What it ignores |
|---|---|
*.so |
Shared object |
*.dylib |
macOS dynamic library |
*.dll |
Dynamic link library |
Code coverage
| Pattern | What it ignores |
|---|---|
*.lst |
Code coverage |
Compiled Static libraries
| Pattern | What it ignores |
|---|---|
*.a |
Static library |
*.lib |
Library file |
Executables
| Pattern | What it ignores |
|---|---|
*.exe |
Windows executable |
How to use this .gitignore for D
- Copy the D 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.