1. Ignore a directory
A trailing slash matches a directory, so the whole node_modules folder is ignored.
node_modules/Typorithm · easy
Step 1 of 8 · intro card
Basics
.gitignore lists glob patterns Git should not track. A trailing slash matches directories, * is a wildcard, and a leading ! un-ignores (negates) a pattern. Files already tracked are not ignored until you git rm --cached them.
.gitignore is a plain-text file listing glob patterns for paths Git should never track — things like dependencies, build output, and secrets.
Patterns are flexible: a trailing slash (node_modules/) matches a directory, * is a wildcard (*.log matches any .log file), and a plain name (.env) matches that exact file. A leading ! negates a pattern, un-ignoring something a broader rule would have hidden.
One important gotcha: .gitignore only affects untracked files. A file Git already tracks keeps being tracked until you remove it from the index with git rm --cached, even after you add it to .gitignore.
A trailing slash matches a directory.
* is a wildcard; !pattern un-ignores.
Already-tracked files need git rm --cached to stop tracking.
node_modules/
*.log
.env
dist/
!keep.txtConnect each part of the code to the concept before you type.
A trailing slash matches a directory, so the whole node_modules folder is ignored.
node_modules/* is a wildcard, so *.log matches every file ending in .log.
*.logA plain name like .env ignores that exact file (keeping secrets out of the repo).
.envdist/ ignores the build-output directory, which is regenerated and need not be tracked.
dist/A leading ! negates a pattern, un-ignoring keep.txt even if a broader rule would hide it.
!keep.txtRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.