Git — Ignore
.gitignore
# .gitignore file
node_modules/
.env
*.log
dist/
.DS_Store
Pattern Syntax
| Pattern | Description |
|---|---|
| *.log | All .log files |
| dir/ | Directory |
| !file.txt | Negate (include) |
| **/temp | All temp dirs |
Common Ignores
# Dependencies
node_modules/
vendor/
# Build output
dist/
build/
# Environment
.env
.env.local
# IDE
.vscode/
.idea/
*.swp
# OS
.DS_Store
Thumbs.db
Ignore Tracked Files
git rm --cached file.txt
Global Ignore
git config --global core.excludesfile ~/.gitignore_global
Check Ignored Files
git check-ignore -v file.txt
Mini Practice
- Create .gitignore
- Ignore directories
- Use wildcards
- Stop tracking ignored files
Up Next
Continue with .gitignore — .gitignore patterns.
Related Topics
Frequently Asked Questions about Ignore
What is Ignore in Git?
Ignore is a fundamental concept in Git. This lesson explains it step by step with clear examples, making it easy for beginners to understand.
How do I learn Ignore?
Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Ignore.
Why is Ignore important in Git?
Ignore is essential for Git development. Understanding this concept will help you write better code and solve real-world problems more effectively.