... | ... | @@ -19,14 +19,24 @@ git clone <cloning_link_for_my_awesome_project> |
|
|
git submodule add <cloning_link_for_other_awesome_project>
|
|
|
```
|
|
|
That will eventually prompt you for your access credentials to the other project and clone the contents into a subdirectory of the same name.
|
|
|
* If you would like to update the content of the submodule, do
|
|
|
```bash
|
|
|
git submodule update
|
|
|
```
|
|
|
|
|
|
* If you clone a repository which already contains a submodule, cloning the main repository creates an empty folder for the submodule. You have to separately pull the submodules. After cloning, browse into the folder of the clone and do:
|
|
|
```bash
|
|
|
git submodule init
|
|
|
git submodule update
|
|
|
```
|
|
|
|
|
|
Updating the submodule(s) to latest commit
|
|
|
---------------------------------------
|
|
|
*By default, a submodule always points to a certain commit of the submodule repository. This does not change if you pull the main repository. In order to update also the submodulesto the latest commit, you can either just successively browse to each the submodule folder and pull the branch of your choice (in many cases, that will be 'origin master'):
|
|
|
```bash
|
|
|
git pull <remote branch name>
|
|
|
```
|
|
|
*Or, you can browse to the main repository and simultaneously pull all submodules:
|
|
|
```bash
|
|
|
git pull --recurse-submodules
|
|
|
git submodule update --remote
|
|
|
```
|
|
|
|
|
|
|
|
|
|