私は次の問題があります:スーパープロジェクトの特定のコミットをチェックアウトしてgit update submodules
を実行すると、サブモジュールのコミットはチェックアウトされず、これは、このコマンドがマンページ、インターネットブログの投稿などに基づいて行うべきことですが。私はまだ手動で正しいコミットを確認するためにgit submodule <path/to/submodule>
を実行する必要があります。`git submodule update`はサブモジュール内のコミットをチェックアウトしません
私はgitがそのように動作するようになることが誰に分かっていますか?私はgit version 2.11.0
を使用しています。
作業ツリーはクリーンです。
[email protected]:~/projects/testcompile/superproject$ git status
HEAD detached at origin/master
nothing to commit, working tree clean
サブモジュールproblematic_submodule
の正しいコミットがチェックアウトされています。 (その行が+
/-
が付いていません。)
[email protected]:~/projects/testcompile/superproject$ git submodule
+321fce0da25208bf886d85ce4a2f1cefc02bbfff modules/libgksl (v1.2-9-g321fce0)
... some other modules ...
9acb4a5d28d1ac785fce17799d58e21cc437b77d modules/problematic_submodule (v0.19-3355-g9acb4a5d2)
私はまだプッシュされていない親プロジェクトのローカルマスタ、外にチェックアウトしています:今、私は更新したい
[email protected]:~/projects/testcompile/superproject$ git checkout master
Previous HEAD position was 4b58c94... Merge branch 'dev' into 'master'
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
彼らが持っているので、サブモジュールは、正しいコミットをチェックアウト:
[email protected]:~/projects/testcompile/superproject$ git submodule update --recursive
Fetched in submodule path 'modules/libgksl', but it did not contain a20f22f989afbcbb620303a6b418de8093c71259. Direct fetching of that commit failed.
ああ、problematic_submodule
は間違ったコミット時にはまだです。 (行が+
が付いていることに注意してください。)
[email protected]:~/projects/testcompile/superproject$ git submodule
+321fce0da25208bf886d85ce4a2f1cefc02bbfff modules/libgksl (v1.2-9-g321fce0)
... some other modules ...
+9acb4a5d28d1ac785fce17799d58e21cc437b77d modules/problematic_submodule (v0.19-3355-g9acb4a5d2)
私はそれをチェックアウトしますproblematic_submodule
を指定する必要があります。
[email protected]:~/projects/testcompile/superproject$ git submodule update modules/problematic_submodule/
Submodule path 'modules/problematic_submodule': checked out '24b46f28edf9c75bf8a7bcf4cac7aa65564c88c9'
を今だけ正しいproblematic_submodule
のコミットをチェックアウトされています。 (線はもはや+
付いている。)
[email protected]:~/projects/testcompile/superproject$ git submodule
+321fce0da25208bf886d85ce4a2f1cefc02bbfff modules/libgksl (v1.2-9-g321fce0)
... some other modules
24b46f28edf9c75bf8a7bcf4cac7aa65564c88c9 modules/problematic_submodule (v0.19-3551-g24b46f28e)
gitサブドゥール内の特定のコミットをチェックアウトするためにあなたが与えたコマンドは何ですか? – LethalProgrammer
'サブモジュールパス 'modules/libgksl'で取得されましたが、a20f22f989afbcbb620303a6b418de8093c71259は含まれていませんでした。そのコミットの直接フェッチに失敗しました。これは私にはエラーメッセージのように聞こえます。サブモジュール 'modules/libgksl'のこのエラーのため、コマンド全体がキャンセルされるのでしょうか? 'git submodule update modules/problematic_submodule'は動作しますか? – kowsky
@LethalProgrammer:あなたが何を意味するのか分かりません。 '9acb4a5d28d1ac785fce17799d58e21cc437b77d modules/problematic_submodule(v0.19-3355-g9acb4a5d2)'の行頭に '+'や '-'が付いていないため、正しいコミットサブモジュールがチェックアウトされます。 – Multisync