DEV Community

Discussion on: Git Submodules Revisited

Collapse
 
netchkin profile image
Pavel Janečka • Edited

What's keeping me from using submodules mainly is not being able to reference commits by tags. It may be viewed as sheer laziness, but tags denote versions imho, and using branches just creates a lot of space for unintended errors, and don't get me started on commit hashes. :)

EDIT: sorry, I kept the main thing in my head only. So, the thing is, I want to keep it explicit which versions of deps my code relies on. That's why I consider tags a would-be ideal option.

Collapse
 
dwd profile image
Dave Cridland

When you checkout a project's commit, you also checkout the dependency commits at that point - the commit of the submodule is part of the version history of the parent.

But a git tag of the parent doesn't create a tag in the child repositories - that's probably a good thing, though.

Collapse
 
netchkin profile image
Pavel Janečka

That's something different than I had in mind. The thing is, when I want to manage or view versions of submodules, I'd like to use their respective version tags.