Get up and running with gitignore in under 5 minutes.
The easiest way to get started:
cd your-project
gitignore auto
This automatically detects your project type and creates an appropriate .gitignore.
For specific languages/frameworks:
# Single language
gitignore init python
# Multiple languages
gitignore init python node vscode
# Add common patterns
gitignore node_modules/ *.log .env
# Add custom patterns
gitignore dist/ build/ *.tmp
# Create new project
mkdir my-python-app
cd my-python-app
git init
# Initialize with Python template
gitignore init python
# Add editor-specific patterns
gitignore init vscode
# Add custom patterns
gitignore .env secrets/
Result: Your .gitignore now contains Python, VS Code, and custom patterns.
cd existing-node-project
# Auto-detect (will find package.json)
gitignore auto
# Or manually specify
gitignore init node
# Add more patterns
gitignore node_modules/ dist/ .env
cd my-fullstack-app
# Initialize with multiple templates
gitignore init python node java
# Add OS-specific patterns
gitignore init linux
# Add editor patterns
gitignore init vscode intellij
For beginners or when unsure:
# Start interactive template selection
gitignore -t
# Or use long form
gitignore interactive
This shows a numbered menu of available templates.
Use dry-run to see what would happen:
# Preview auto-detection
gitignore --dry-run auto
# Preview template initialization
gitignore --dry-run init python node
After running gitignore, you’ll have:
your-project/
├── .gitignore # Main gitignore file
├── .gitignore_backup/ # Automatic backups (if enabled)
└── ...other files
Check your .gitignore was created correctly:
# View contents
cat .gitignore
# Check git status
git status
# See what files are ignored
git ls-files --others --ignored --exclude-standard
gitignore list to see available templatessudo if installing system-widemake PREFIX=~/.local install/usr/local/bin/gitignore --versionYour project now has a proper .gitignore file. Here are some next steps: