Guides
Ignoring Files with .ditsignore
Control which files Dits tracks by specifying patterns in a .ditsignore file. Keep your repository clean by excluding build artifacts, temporary files, and sensitive data.
Similar to .gitignore
If you're familiar with Git, .ditsignore uses the same pattern syntax as .gitignore. You can often use your existing .gitignore as a starting point.
Creating a .ditsignore File
Create a file named .ditsignore in your repository root:
# Create .ditsignore
touch .ditsignore
# Or copy from your existing .gitignore
cp .gitignore .ditsignorePattern Syntax
Pattern Reference
| Pattern | Description | Example Matches |
|---|---|---|
| *.ext | All files with extension | file.ext, dir/file.ext |
| dir/ | Directory and contents | dir/*, dir/sub/* |
| **/file | File in any directory | file, a/file, a/b/file |
| dir/**/file | File in dir or subdirs | dir/file, dir/a/b/file |
| !pattern | Negate (don't ignore) | Track despite earlier rule |
| [abc] | Character class | a, b, or c |
| ? | Single character wildcard | file?.txt matches file1.txt |
Common Templates
Node.js / JavaScript
# Dependencies
node_modules/
package-lock.json
# Build output
dist/
build/
.next/
# Environment
.env
.env.local
.env.*.local
# IDE
.vscode/
.idea/
# OS files
.DS_Store
Thumbs.dbVideo Production
# Render outputs (re-generate from project)
renders/
exports/
*.mp4
*.mov
# Cache files
*.peak
*.pkf
Media Cache/
# Proxies (managed by Dits proxy system)
proxies/
# Keep project files
!*.prproj
!*.aep
!*.drpGame Development
# Build outputs
Build/
Builds/
*.exe
*.app
# Cache
Library/
Temp/
obj/
# IDE
.vs/
*.csproj.user
# Keep assets
!Assets/**/*.fbx
!Assets/**/*.pngChecking Ignored Files
# Check if a file is ignored
$ dits check-ignore myfile.log
myfile.log
# See which rule ignores a file
$ dits check-ignore -v myfile.log
.ditsignore:5:*.log myfile.log
# List all ignored files
$ dits status --ignoredGlobal Ignore File
Create a global ignore file for patterns that apply to all your repositories:
# Set global ignore file
dits config --global core.excludesfile ~/.ditsignore_global
# Add common patterns
echo ".DS_Store" >> ~/.ditsignore_global
echo "Thumbs.db" >> ~/.ditsignore_global
echo "*.swp" >> ~/.ditsignore_globalAlready Tracked Files
Adding a path to
.ditsignore does not remove an entry that is already tracked. The current CLI has no dedicated untrack-while-preserving-the-worktree command. Treat ignore rules as a pre-staging filter, check dits status, and evaluate any tracked-file removal workflow only on backed-up data.Related Topics
- File Commands - Managing tracked files
- Configuration - Global settings
- Large Files Guide - Handling big assets