VCS, GIT

Git inside Git, The definitive guide to Submodule

It is pretty common that you will use other people library or even your own but it is located in another git. So you want git inside git!, here how to use git inception.

To create git inside git, it’s called submodule

Add submodule

Inside the master git do

$ git submodule add <clone_url> <destination_path>

Pull submodule

You can do $ git pull inside the submodule directory or in the master git directory do

$ git submodule update --remote

Commit submodule

You can do $ git commit inside the submodule directory or in the master using $ git commit -am <message>

Remove submodule

$ rm -rf .git/modules/<module_name>