0

This is an output of git-branch -av inside a submodule directory (which points to a branch of another repository):

# git branch -av
* (HEAD detached from 77f2f45)               29364b9 Merge branch 'adt' into v3

What is the current revision of this submodule, 77f2f45 or 29364b9?

Edit: This is obviously not a duplicate of Why is my GIT Submodule HEAD detached from master?. The output HEAD detached from doesn't even appear in that question.

This question isn't asking what a detached head is or why the head is detached (it's a submodule after all), but what the output from 77f2f45 means. An answer should probably start with "77f2f45 is the commit ...".

AndreKR
  • 28,030
  • 13
  • 86
  • 146
  • It's normal for a submodule to be in a detached head state, since a submodule is always tracking a certain commit. See [this answer](https://stackoverflow.com/a/48556186/7598462). – kowsky Mar 25 '19 at 14:37
  • 4
    Possible duplicate of [Why is my GIT Submodule HEAD detached from master?](https://stackoverflow.com/questions/18770545/why-is-my-git-submodule-head-detached-from-master) – kowsky Mar 25 '19 at 14:41

1 Answers1

0

77f2f45 is the commit that the submodules HEAD is pointing too. If this was a submodule and I did checkout 77f2f45 and this commit was not the most recent, I would be in a detached state, which means any changes I commit, will not be part of a branch. HOWEVER, the default state of submodule is a detached state if you havn't explicitly told it to track a branch, even if you checked out the most recent commit of said branch. See https://stackoverflow.com/a/36375256/11308441 for more detail on this.

29364b9 is the commit that the parent repo is currently using to reference your submodule.

Davey
  • 156
  • 4