Gitのサブモジュール操作

ググれば出てくるんだけど、頻繁に使うので、自分でもメモしておく。

Gitのサブモジュール

サブモジュールを含むプロジェクトのClone

git clone --recursive <URL>

サブモジュールの追加

git submodule add <URL> <path(optional)>

サブモジュールの削除

git submodule deinit -f <name>
git rm -f <name>
rm -rf .git/modules/<name>

サブモジュールの更新

git submodule update --init --recursive