Git worktree and submodule interaction still forces manual --force after 11 years
A developer examining Git's command-line safety flags found that removing or moving a git worktree containing submodules requires the --force flag, a restriction dating back to git worktree's 2015 introduction. The analysis traces how git worktree add had to be patched to ignore submodule.recurse to avoid corrupting empty submodule paths, and argues that git submodules function as a de facto package manager, with the gitlink SHA acting as a lockfile entry and .gitmodules as the manifest.
GoKawiil's interpretation of the reporting above, not reported fact.
The piece highlights a long-standing rough edge in Git's design where two major features—worktrees and submodules—were never fully reconciled, forcing users into manual overrides. It also reframes submodules as an accidental, clunky package management system, explaining why many projects adopt and then abandon them despite having all the theoretical pieces (manifest, lockfile, install step) of a proper dependency manager.
- Git worktree has required --force to remove or move worktrees with submodules since at least 2015.
- git worktree add needed patching to ignore submodule.recurse to prevent it from wrongly recursing into empty submodule directories.
- Git submodules technically mirror package manager concepts (.gitmodules as manifest, gitlink SHA as lockfile) but deliver a much worse user experience.
Pro Git (2nd Edition) by Scott Chacon and Ben Straub — If wrestling with worktrees and submodules has you reading man pages line by line, Pro Git is the reference that explains git's internals and workflows in plain language. It covers submodules and repository plumbing in depth, so the next collision between features makes sense before you reach for --force.
See Pro Git (2nd Edition) by Scott Chacon and Ben Straub on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.Source: nesbitt.io — Andrew Nesbitt, 2026-09-01
Published there as: “Git Submodules as a Package Manager”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.