Spot the Gitignore Mistake
Find the Mistake Easy
Question
This .gitignore line is meant to ignore the 'node_modules' directory. What is wrong?
Code
node_modules
Hint
A trailing slash specifies a directory only.
Explanation
While node_modules works, the convention is node_modules/ with a trailing slash to explicitly target only directories. Without the slash, it would also ignore a file named 'node_modules' if one existed. The trailing slash makes the intent clearer and is best practice for directory ignores.
Related Resources
Related Lessons
Related Cheatsheets
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.