Gitflow
👋Stop Tracking a File Without Deleting ItEasy+300 XP
Workshop
Scenario reference

Stop Tracking a File Without Deleting It: the situation, step by step

The situation

`config/local.yml` is checked in. It should be developer-local. You need to stop tracking it but keep the file on disk.

`git rm --cached` removes from index, leaves working tree.

Easy · 2 steps · +300 XP

What you will practice

This scenario walks through 2 steps, in order:

  1. 01Untrack the file but keep it
  2. 02Commit the untrack
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. Untrack the file but keep it
    git rm --cached config/local.yml
  2. 2. Commit the untrack
    git commit -m "chore: stop tracking local config"

Key takeaway

Add to .gitignore at the same time so it doesn't get re-added.