What is a submodule in git?

Posted on

Question :

One day I cloned a library in github and there was an instruction to use the git submodule update command.

I have been working with git for some time and I was not aware of this command until then.

What is this submodule command for?


Answer :


This command is useful when you want to insert another git repository into your main project (a library, for example).

For git the submodule will be a totally independent project. You can edit the contents below the submodule folder, commit, push, etc. Provided you have permission to do so:)

There are alternatives, such as package managers, that organize dependencies in other, more efficient and secure ways.


Leave a Reply

Your email address will not be published. Required fields are marked *