git submodule update でエラーが出ているのを解消したいのですが、方法が解らず困っています。
サブモジュール側のリポジトリで、「sub_develop」のようなブランチを作った事があり、その当時は正常にsubmodule updateできたのです。
最近、サブモジュール側のリポジトリでブランチを整理して、
「sub_develop/ticket001」
「sub_develop/test」
のようにしました。sourcetreeで階層的に見えるので便利かと思ったのです。
当然、リモートで「sub_develop」ブランチは削除しました。
その後、目的のリポジトリで「$ git submodule update --init --recursive --remote 」と実行しましたが、エラーが出て失敗してしまうのです。
error: unable to create directory for c:/main_repo/.git/modules/submodules/sub_repo/refs/remotes/origin/sub_develop/ticket001
From example.co.jp:/sub_repo/sub_repo
! [new branch] sub_develop/ticket001 -> origin/sub_develop/ticket001 (unable to update local ref)
サブモジュール側のリポジトリでもgit pull に失敗していたのですが、その時はこの方法で対処しました。
git (中略) fetch --prune origin
gitでは、「sub_develop」「sub_develop/ticket001」のようなブランチは共存できないようなので、それが原因だとみています。
強制的にupdate出来ないものかと以下のコマンドを実行しましたが同じエラーです。
$ git submodule update --init --recursive --remote -f
ローカルのブランチを無視して強制的にgit submodule updateするにはどうしたらいいのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。