Let's say you have a local repo and want it to be exactly as the last commit in your remote repo.
These are the steps that I'm typing in order to achieve this:
cd <main repo>
git clean -fxd (clean all untracked files that aren't submodules)
git submodule foreach git clean -fxd (clean all untracked files in submodules)
git reset --hard (clean all uncommited changes in our main repo)
git submodule foreach git reset --hard (clean all uncommited changes in submodules)
git submodule update --init --recursive (update all submodules with one on remote repo)
The problem is that these won't delete any extra submodules that are in my local repo but not in the remote repo.
Any help in improving my series of steps would be greatly appreciated.
From the docs:
so
git clean -dffx