Repo Cleanup For Tracked Files Use Git Rm

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

vamseeachanta Updated

File contents

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

For Tracked Files (Use git rm)

# 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)

# 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

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

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

vamseeachanta/workspace-hub/tree/main/.agents/skills/_internal/meta/repo-cleanup/for-tracked-files-use-git-rm commit 5604586d7b

Frequently asked questions

npx skillmds@latest add vamseeachanta/repo-cleanup-for-tracked-files-use-git-rm