Nic
1/7/2020 - 11:24 AM

Convert a git subdirectory to a submodule

# Add the to-be submodule url to .gitmodules;
git submodule add <repo-url> <local-path>

# move the .git directory to the submodules space;
git submodule absorbgitdirs <local-path>

# Update git and all submodules
git submodule update --init --recursive

# Commit without githooks
git commit -am "..." --no-verify