How to do it...

  1. We'll add a subproject, lib_a, to the super project as a Git submodule:
$ git submodule add lib_a 
Cloning into 'lib_a'... 
remote: Counting objects: 18, done. 
remote: Compressing objects: 100% (14/14), done. 
remote: Total 18 (delta 4), reused 17 (delta 3) 
Receiving objects: 100% (18/18), done. 
Resolving deltas: 100% (4/4), done. 
Checking connectivity... done. 
  1. Let's check git status using the following command:
$ git status 
On branch master 
Your branch is up-to-date with 'origin/master'. 

Changes to be committed: 
  (use "git reset HEAD <file>..." to unstage)  

  new file:   .gitmodules 
  new file:   lib_a 
  1. We can take a closer look at the two ...

Get Git Version Control Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.