Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

git submodule status does not report branch. Bug?

Windflower Waters January 25, 2022

I set the branch that I want my submodule to point to using this command:

git submodule set-branch -b <branch-name> <path to submodule>

That works. I can see the branch = <branch name> in .gitmodules.

Then I update the submodule to the head of the branch like this:

git submodule update --remote <path to submodule>

That does update to the commit that matches the head of the branch.

However, when I ask:

git submodule status <path to submodule>

It reports that the submodule is on the main track, not on my branch. 

I just want it to read the <branch name> from .gitmodules.

I think this is a bug in git because all the git documentation shows that it the branch should be displayed by git submodule status. 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2022

Hi @Windflower Waters,

The following page has info on how/where to report bugs with Git:

However, I would suggest first checking what version of Git you have installed locally and upgrading to the latest version.

I have tried the steps you mentioned in your question on my machine (with the latest version of Git installed) and git submodule status <path to submodule> returns the HEAD of the branch I determined.

You can check the version of Git on your machine with the command git --version

The latest version available is listed here: https://git-scm.com/downloads

If you have an older version locally, can you try upgrading to the latest one and see if the issue persists?

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events