This basically discard all changes, commits, etc. which are not pushed to remote yet, and pull the latest version from the remote.
git fetch origin master
git reset --hard FETCH_HEAD
git clean -df
This will add external repositories as submodules into the current repository.
git submodule add <repo-url> <sub-module-name>
This is how you clone a repository that contains submodules.
git clone -recurse-submodules -j8 <main-repo-url>
Rename
master
tomain
.