Files
holocron/plugins/git/.apm/skills/git-submodules/references/removal.md
Defame1297 ae791781c2 fix(git): restore router coverage and commands the retrofit dropped
git-workflow calls itself a router but named two of the six domains it routes to;
the other four appeared nowhere in the file. All six are now named, with a
routing table in the always-loaded body.

git-submodules lost the foreach shell-variable semantics -- only the bare names
survived, though $sm_path and $displaypath differ solely by which directory you
are in. The table is back. Its relocated commands had also dropped the rtk git
prefix its own SKILL.md mandates; 24 of them are re-prefixed. The wider rtk
inconsistency across the plugin stays with #113.

Also restores git-commits' body and footers output fields, git-branches' tag/
branch detection commands, git-worktrees' git config --worktree, pc-run's
ambiguity fallback, git-remotes' git-history boundary, and git-history's pickaxe
triggers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EJJrm5YmacbwMdzZpXcoti
2026-08-31 19:46:35 +00:00

33 lines
1.2 KiB
Markdown

---
topic: submodules
source_keys:
- git-scm-submodule-docs
---
# Removing and deinitializing a submodule
Both operations are destructive. Confirm with the user before executing either.
## `deinit` is not removal
```bash
rtk git submodule deinit <path> # --all for every submodule, -f if locally modified
```
`deinit` clears the submodule's section from `.git/config` and empties its working tree. The
`.gitmodules` entry and the gitlink in the superproject's index are untouched, so the submodule is
still registered and a later `update --init` brings it straight back. Use it to reclaim disk space
or to reset a broken checkout, not to delete a dependency.
## Full removal, in order
```bash
rtk git submodule deinit -f <path> # unregister from .git/config
rtk git rm <path> # drop the .gitmodules entry and the gitlink from the index
rm -rf .git/modules/<name>/ # stale git dir: not tracked, not cleaned up by git
rtk git commit -m "chore: remove <name> submodule"
```
The third step is the one that gets skipped. `.git/modules/<name>/` survives `rtk git rm`, and while it
is present Git refuses to add a submodule at the same path again.