git submoduleについての備忘録
よく忘れる操作をまとめました。
なお各項目において、GitHub上のcohsh/qeinput
(ローカルにおいては./qeinput
)をサブモジュールの例として扱います。
追加
git submodule add https://github.com/cohsh/qeinput.git
削除
git submodule deinit -f qeinput
git rm -f qeinput
rm -rf .git/modules/qeinput
更新
git submodule update --remote
サブモジュールを含むリポジトリのclone
cohsh/qeinput
をサブモジュールとして含むcohsh/q-e-template
を例とします。
git clone --recursive https://github.com/cohsh/q-e-template.git