A subtree merges the library's files into a folder of the superproject, so every clone, archive and CI checkout simply has them. git subtree, a script from Git 1,932 's contrib directory, ships with Git for Windows 47,417 and most Linux packages. Sam swaps the submodule for a subtree at the same version:
git rm -q public/vendor/ui .gitmodules
git commit -qm "Remove the booknest-ui submodule"
rm -rf .git/modules/public/vendor/ui
git subtree add --prefix=public/vendor/ui ../server/booknest-ui.git v1.1.0 --squash
git log --oneline --graph -3git fetch ../server/booknest-ui.git v1.1.0 From ../server/booknest-ui * tag v1.1.0 -> FETCH_HEAD Added dir 'public/vendor/ui' * a4df0db Merge commit 'a58db60bf9664e0859e37d97de873cfe0431f0c8' as 'public/vendor/ui' |\ | * a58db60 Squashed 'public/vendor/ui/' content from commit 0e31a26 * 391ec68 Remove the booknest-ui submodule
git rm removed the gitlink and .gitmodules, and deleting .git/modules/... discarded the submodule's clone. subtree add fetched the tag over the plain path (a fetch you run yourself is not restricted like a submodule clone), and --squash folded the library's history into one commit, merged in under the prefix. The files are now ordinary tracked files, and the commit messages record the library commit (0e31a26) so later pulls know where they left off.
