Gitflow
🙈.gitignore Isn't IgnoringEasy+350 XP
Workshop
Scenario reference

.gitignore Isn't Ignoring: the situation, step by step

The situation

You added `dist/` to .gitignore but `git status` keeps showing dist files as modified. The folder was already tracked.

.gitignore only ignores UNtracked files. Already-tracked files need `git rm --cached`.

Easy · 3 steps · +350 XP

What you will practice

This scenario walks through 3 steps, in order:

  1. 01Stop tracking the folder without deleting it on disk
  2. 02Commit the untrack
  3. 03Confirm clean
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. Stop tracking the folder without deleting it on disk
    git rm -r --cached dist
  2. 2. Commit the untrack
    git commit -m "chore: stop tracking dist"
  3. 3. Confirm clean
    git status

Key takeaway

Untrack with `rm --cached` to make .gitignore work for already-added files.