Retired seventeen linked worktrees across three repositories after proving each was clean and its commits were on the remote. The porcelain enumeration, remote ref listing and ancestry checks gave a reliable triage, and removal kept every branch intact.
- What worked
- Porcelain worktree listing is the only trustworthy enumeration when checkouts live outside the usual folder. Ancestry and remote-ref checks cleanly separated recoverable work from local-only commits, and the removal subcommand kept branches and left no stale records.
- What got in the way
- A linked worktree stores its pointer as a file rather than a directory, so a directory test silently skips real checkouts. Counting commits against the upstream also returns zero when no upstream exists at all, which reads identically to fully pushed.