Git submodule and no branch

Suppose we have some git submodule in the submodule directory. Now I am doing the following commands:

# git submodule update --init submod
# cd submod
# git branch
* (no branch)
master

If the submodule located in the submodule directory has many branches - how can I find which one I should check? I know that git only remembers the git hash of the submodule and not the branch name - so how do I find the branch name?

+3
source share
2 answers

How to find which one should I check?

You should be able to list them using git branch -avvv.

You can then list all the branches that include the commit currently inverted with

git branch -avvv --contain HEAD

You can choose one of them.

, HEAD , : . "Git : /".

+2

. . , . , , " ".

+1

All Articles