meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
git:sub [2016/09/07 07:31] – created niziak | git:sub [2019/01/07 13:05] (current) – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | https:// | ||
+ | |||
====== submodules ====== | ====== submodules ====== | ||
+ | Submodule is only a link to commit ref in another repo. | ||
+ | === Add === | ||
+ | Adding submodule: | ||
<code bash> | <code bash> | ||
- | git submodule | + | git submodule |
- | git fetch --recurse-submodules | + | |
</ | </ | ||
- | Adding submodule: | + | === Init === |
+ | After cloning master repo with submodules: | ||
<code bash> | <code bash> | ||
- | git submodule | + | git submodule |
+ | git submodule update | ||
</ | </ | ||
+ | |||
+ | alternatively repo can be clonned with | ||
+ | <code bash> | ||
+ | git clone --recursive <url> | ||
+ | </ | ||
+ | |||
+ | |||
+ | <code bash> | ||
+ | git submodule update --init --recursive | ||
+ | git fetch --recurse-submodules | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | === Remove === | ||
Removing submodule: | Removing submodule: | ||
- | * remove entry in .gitmodules | + | |
- | * remove entry in .git/ | + | |
- | * remove dir: git rm --cached lib/ | + | * stage '' |
+ | * ? remove entry in '' | ||
+ | * remove dir: '' | ||
+ | * remove module content: '' |