サブモジュールを使用するgitプロジェクトを取得すると、サブモジュールには分離ヘッドがあります。私はここでstackoverflowの多くの記事を読んで、彼らはその問題は解決すべきだと言います - 私は何か間違っているが、何を検出することはできません。何が起こるかだGitサブモジュールがまだデタッチされたヘッドを持っています
:
M.Grunwald % git clone -b BranchName ssh://[email protected]:7999/~m.grunwald/repo_with_submodules.git some_repo
Cloning into 'some_repo'...
remote: Counting objects: 26, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 26 (delta 9), reused 0 (delta 0)
Receiving objects: 100% (26/26), done.
Resolving deltas: 100% (9/9), done.
M.Grunwald % cd some_repo
M.Grunwald % cat .gitmodules
[submodule "Library/MyLib"]
path = Library/MyLib
url = ssh://[email protected]:7999/~m.grunwald/my_lib.git
branch = BranchName
M.Grunwald % git submodule init
Submodule 'Library/MyLib' (ssh://[email protected]:7999/~m.grunwald/my_lib.git) registered for path 'Library/MyLib'
M.Grunwald % git submodule update --remote
Cloning into
'/cygdrive/c/Users/m.grunwald/Documents/TMP/some_repo/Library/MyLib'...
Submodule path 'Library/MyLib': checked out '5c665e00cca5eb24d9b615294807520a6036fa90'
git submodule update --remote 4.31s user 10.61s system 10% cpu 2:21.52 total
M.Grunwald % cd Library/MyLib
M.Grunwald % git status
HEAD detached at 5c665e0
nothing to commit, working tree clean
をそうで、.gitmodulesは「ブランチ= branchname」を含め、サブモジュールが含まれていると私は--remoteとサブモジュールの更新を呼び出す...何がまだ欠けていますか?私は(CWDがsome_repo /ライブラリ/ MYLIBです)BranchNameに切り替えた場合は何が起こるかだ
%のgit --version gitのバージョン2.12.3
:
M.Grunwald% git branch -r
origin/HEAD -> origin/master
origin/BranchName
M.Grunwald % git checkout BranchName
Branch BranchName set up to track remote branch BranchName from origin.
Switched to a new branch 'BranchName'
M.Grunwald % git status
On branch BranchName
Your branch is up-to-date with 'origin/BranchName'.
nothing to commit, working tree clean
M.Grunwald % cd ..
M.Grunwald % ..
M.Grunwald % git status
On branch BranchName
Your branch is up-to-date with 'origin/BranchName'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: Library/MyLib (new commits)
M.Grunwald % git diff Library/MyLib
diff --git a/Library/MyLib b/Library/MyLib
index 1341b30..5c665e0 160000
--- a/Library/MyLib
+++ b/Library/MyLib
@@ -1 +1 @@
-Subproject commit 1341b30ae55df1afc7265a9110fbf09661dd627b
+Subproject commit 5c665e00cca5eb24d9b615294807520a6036fa90
使用しているGitのバージョンは何ですか? –
サブモジュールで 'BranchName'をチェックアウトすると、スーパープロジェクトに変更がありますか? –
こんにちはNils、私の更新を参照してください – Markus