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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.