# Repo Cleanup For Tracked Files Use Git Rm

> Sub-skill of repo-cleanup: For Tracked Files (Use git rm) (+2).

- Skill: `vamseeachanta/repo-cleanup-for-tracked-files-use-git-rm` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/repo-cleanup-for-tracked-files-use-git-rm`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/repo-cleanup-for-tracked-files-use-git-rm/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/repo-cleanup-for-tracked-files-use-git-rm

---


# For Tracked Files (Use git rm) (+2)

## For Tracked Files (Use git rm)


```bash
# Remove tracked file
git rm path/to/file

# Remove tracked directory
git rm -r path/to/directory

# Remove from git but keep local copy
git rm --cached path/to/file
```

## For Untracked Files (Use rm)


```bash
# Remove untracked file
rm path/to/file

# Remove untracked directory
rm -rf path/to/directory

# Interactive removal (safer)
rm -i path/to/file
```

## Dry Run First


```bash
# Preview what would be deleted
git clean -n -d

# Preview including ignored files
git clean -n -d -x
```

