I have checked out a project that includes some submodules.
First I checked out my project
and then the submodules
:
git clone git@my-gitlab-server:namespace/project.git
Initiatiated the submodules for that branch
with the latest:
git submodule update --init --recursive
Then I checked out the specific branch that includes the submodules. I just want to get the branch name of each sumbodule.
But:
$ git --git-dir path/to/my/submodule rev-parse --abbrev-ref HEAD
fatal: not a git repository: 'path/to/my/submodule'
$ cd path/to/my/submodule
$ (detached*)$ git branch
* (HEAD detached at 24bbc55)
develop
Why the first command shows that it is not a git submodule? (while it is)
The checkout is done from a specific branch ('develop') of the submodule. How can I get the actual branch name (and not the git sha
?)