Skip to main content
Documentation

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.

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 .ditsignore

Pattern Syntax

Basic Patterns
# Ignore specific file
secret.key

# Ignore by extension
*.log
*.tmp
*.cache

# Ignore directory
node_modules/
build/
dist/

# Ignore files in any directory
**/debug.log
Negation Patterns
# Ignore all .log files
*.log

# But track important.log
!important.log

# Ignore build/ but keep build/readme
build/
!build/readme.md

Pattern Reference

PatternDescriptionExample Matches
*.extAll files with extensionfile.ext, dir/file.ext
dir/Directory and contentsdir/*, dir/sub/*
**/fileFile in any directoryfile, a/file, a/b/file
dir/**/fileFile in dir or subdirsdir/file, dir/a/b/file
!patternNegate (don't ignore)Track despite earlier rule
[abc]Character classa, b, or c
?Single character wildcardfile?.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.db

Video 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
!*.drp

Game Development

# Build outputs
Build/
Builds/
*.exe
*.app

# Cache
Library/
Temp/
obj/

# IDE
.vs/
*.csproj.user

# Keep assets
!Assets/**/*.fbx
!Assets/**/*.png

Checking 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 --ignored

Global 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_global

Related Topics