サブモジュールを含む clone
git clone –recursive git@github.com:asahina/project.git project
これだけだとサブモジュールが detached headになってしまうので、各サブモジュールのディレクトリにおいて「git checkout main」として紐づけを行う。
サブモジュールの削除
git submodule deinit -f src/json/
git rm -f src/json/
rm -rf .git/modules/src/json/
サブモジュールの追加
git submodule add git@github.com:nlohmann/json.git src/json
特定のタグに強制的に切り替え。
git checkout -f tags/v3.11.2