I think I have good understanding how submodules work. But still don't get
why those commits are "not connected to any branches". Why I am getting
this warning? What I'm doing wrong? IMHO it should just do checkout master
On Friday, August 17, 2012 4:52:43 PM UTC+2, Konstantin Khomoutov wrote:
> On Fri, 17 Aug 2012 06:35:24 -0700 (PDT)
> > 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 ? 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
> I think reading through the whole chapter on submodules is a worthwile
> 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 view this discussion on the web visit
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at