meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revisionBoth sides next revision
git:sub [2016/09/07 07:31] – created niziakgit:sub [2016/09/07 11:32] niziak
Line 1: Line 1:
 +https://andrey.nering.com.br/2016/git-submodules-vs-subtrees/
 +
 ====== submodules ====== ====== submodules ======
 +Submodule is only a link to commit ref in another repo.
  
 +=== Add ===
 +Adding submodule:
 <code bash> <code bash>
-git submodule update --init --recursive +git submodule add <repository> [<relative_local_path>]
-git fetch --recurse-submodules+
 </code> </code>
  
-Adding submodule:+=== Init === 
 +After cloning master repo with submodules:
 <code bash> <code bash>
-git submodule add <repository> [<relative_local_path>]+git submodule init 
 +git submodule update
 </code> </code>
 +
 +alternatively repo can be clonned with 
 +<code bash>
 +git clone --recursive <url>
 +</code>
 +
 +
 +<code bash>
 +git submodule update --init --recursive
 +git fetch --recurse-submodules
 +</code>
 +
 +
  
 Removing submodule: Removing submodule: