Advertising

> I've cloned a fresh repo with submodules and then cd library/module
> && git checkout master
>
> it gives me a warning and I don't understand why and how to avoid it?
>
> Warning: you are leaving 30 commits behind, not connected to
> any of your branches:
>
> 2553655 Merge branch 'master' into prod
> 6b07300 Fix build
> ... and 28 more.
>
> If you want to keep them by creating a new branch, this may be a good
> time to do so with:
>
> git branch new_branch_name 654646464
>
> Branch master set up to track remote branch master from origin.
> Switched to a new branch 'master'
>
>
> What is going wrong here? How did we managed to have commits not
> connected to any of branches?
Did you read [1]? I'm not familiar with submodules, but the cited text
hints that the state of each sumbodule is checked out using that
specific commit's SHA-1 name, and so each submodule normally is in the
"detached HEAD" state. Hence, if the "master" branch of that particular
sumbodule references a commit which is not equal to that specific
commit checked out in the submodule, when you check out that "master"
branch, you do really move that submodule's HEAD pointer and get that
warning.
I think reading through the whole chapter on submodules is a worthwile
thing.
1. http://git-scm.com/book/en/Git-Tools-Submodules#Issues-with-Submodules
--
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/git-users?hl=en.