Using Submodules

Add submodule

git submodule add <repo URL>

Once you have added a submodule to a repo, it wont be pulled down automatically with a pull or clone. Run the below to pull/update the submodule.

git submodule init
git submodule update

Update submodules

git submodule update --recursive --remote

Force clean submodules

git submodule foreach --recursive git reset --hard

git submodule update --init --recursive --remote
If the above doesnt work then

git submodule deinit -f .
git submodule update --init --recursive --remote

For some reason a change on a submodule was staged, so I got rid of it (this ended up being normal and was done again when I updated the submodule again)

git restore .\files\Get-SMART\ --recurse-submodules