Submodule head

I'm using SourceTree on Mac. I have a Git repository with submodules. In SourceTree, these submodules are listed like this:


submodule1 [master]

submodule2 [master]


I made a tag recently, and since then one of the submodules appears like

submodule1 [tag]

although I haven't commited the tagged revision of the submodule in the parent repository. This is only cosmetic, but how can I make it look like before:

submodule1 [master]?

1 answer

Submodules actually track a specific commit so that the parent knows precisely what version of the submodule it's supposed to be using. So it's not unusual for the annotation to change, it might even be a SHA if there are no 'friendly' names for the commit that you're tracking on the submodule project. You shouldn't worry about this, all you need to be sure of is that you're tracking the right commit on the submodule.

If you want to change the commit you're tracking, you just open the submodule project (double-click on the sidebar), check out a different commit there, then return to the parent repo and commit the submodule change.

Sure, but why it was changed to [tag] since neither the tracked commit was the tagged one, nor anything was commited in the base repository (i.e. tracked commit not changed)?

Difficult to say without seeing the repository, but that annotation is simply what git reports from 'git submodule status'.

@Steve Streeting I realize this post is more than two years old now. However, it appears that since the release of v2.1 the additional [whatever] tag has been removed from the interface. I found it extremely useful and haven't found a way to turn it back on. Is there any way to enable it again?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,226 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you