This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
git [2016/06/08 15:27] k2patel [Script for Backup] |
git [2016/06/08 15:37] k2patel [Git reset local] |
||
---|---|---|---|
Line 119: | Line 119: | ||
git pull | git pull | ||
</code> | </code> | ||
+ | |||
+ | ===== Git Submodule ===== | ||
+ | |||
+ | ==== Clone Repository including submodule ==== | ||
+ | |||
+ | <code bash> | ||
+ | git clone --recursive git@github.com:k2patel/repo.git | ||
+ | </code> | ||
+ | |||
+ | ==== clone submodule from existing project ==== | ||
+ | |||
+ | <code bash> | ||
+ | git submodule update --init --recursive | ||
+ | </code> | ||
+ | |||
+ | ==== To initialize single submodule ==== | ||
+ | <code bash> | ||
+ | git submodule update --init modules/repo | ||
+ | </code> | ||
+ | |||
+ | ==== Pull changes from all submodule ==== | ||
+ | <code bash> | ||
+ | git submodule foreach git pull origin master | ||
+ | </code> | ||
+ | |||
+ | ==== Usefull when submodule HEAD and status HEAD messed up ==== | ||
+ | <code bash> | ||
+ | git submodule update --init | ||
+ | </code> | ||
+ | |||
+ | |||