これは、スーパープロジェクト/パス/をネストされたGitリポジトリにすることに注意してください。この場合、SHA1は親プロジェクトによって記録されます。
正確に同じ状態を維持するには、superproject/.git/modules/<module>
をコピーしてsuperproject/path/to/<module>
に名前を変更し、<module>/<module>
の名前を<module>/.git
に変更します。私はまだその.git
フォルダはsuperproject/.git/modules/<module>
になりsuperprojec
のサブモジュールになりたい
mv asubmodule asubmodule_tmp
git submodule deinit -f -- a/submodule
rm -rf .git/modules/a/submodule
# if you want to leave it in your working tree
git rm --cached asubmodule
mv asubmodule_tmp asubmodule
:
は、その後、あなたは、サブモジュールを削除するためにgit submodule deinit
を使用することができます
サブモジュールのgitのディレクトリはサブモジュール内にある場合、
その細やかに$GIT_DIR/modules
パスをサブモジュールのGitのディレクトリを移動し、その後でGitのディレクトリとその作業ディレクトリを接続する:は、どの選択肢を残しませんcore.worktree
を設定し、.git
ファイルを追加して、superprojects gitディレクトリに埋め込まれたgitディレクトリを指定します。
git config
には、移動可能な設定はありません$GIT_DI R/modules
。
absorbgitdirs
はGitの2.12(Q4 2016)
Its tests showsそれはGIT_DIR/modules
を使用する予定のためcommit f6f8586で導入されました。
古いギルト(before Git 1.7.8、2011年10月)はサブモジュールのフォルダの中に直接.git
を持っていました。
可能性のある重複または関連する:https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule – awiebe