

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Gitignore
incomplete
2: Nested Gitignore
incomplete
3: Patterns
incomplete
4: What to Ignore
incomplete
This lesson's interactive features are locked, please to keep using them
Your .gitignore file does not necessarily need to be at the root of your project.
It's fairly common to have multiple .gitignore files in different directories throughout a project. A nested .gitignore file only applies to the directory it's in and its subdirectories.
Let's say you have the following setup:
src/
├── assets/
│ ├── .gitignore
| ├── cover_art.jpg
│ └── onlydevs.png
├── main.py
├── tests.py
├── venv/
│ └── bin/
| ├── activate
│ └── python
.gitignore
Here are the contents of src/assets/.gitignore:
onlydevs.png
main.py
Here are the contents of the root .gitignore:
venv/bin/activate