Git AdvancedLesson 40Free preview
Git .gitignore
This lesson is part of Git · All levels
Summary
The .gitignore file contains a pattern that tells Git not to track certain files or folders, such as build results, dependencies, and secret files. The tracked files remain tracked despite their name entered, so they need to be removed with git rm --cached. Including .gitignore into the repository makes the team agree to ignore the same pattern.
Key points
- Excluding file patterns so they don't track (.gitignore)
- Patterns such as build/ and *.log are recursive per directory
- The tracked files need to be cached.
- It's best to commit to the project.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.