... | ... | @@ -25,10 +25,11 @@ That will eventually prompt you for your access credentials to the other project |
|
|
git submodule init
|
|
|
git submodule update
|
|
|
```
|
|
|
If the submodule structure has been created successfully, you will see in the main repository a folder labeled 'name_of_submodule_repository @ commit_SHA' (pointing to a certain commit of the submodule repository identified by the hash). If you browse to that folder in your clone, you will find the contents of the submodule repository (according to the version of that commit).
|
|
|
|
|
|
Updating the submodule(s) to latest commit
|
|
|
---------------------------------------
|
|
|
* 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'):
|
|
|
* As pointed out above, 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 submodules to the latest commit of each, you can either just successively browse to each submodule folder and pull the branch of your choice (in many cases, that will be 'origin master'):
|
|
|
```bash
|
|
|
git pull <remote branch name>
|
|
|
```
|
... | ... | @@ -62,7 +63,7 @@ git add . |
|
|
git commit -m 'commit message, e.g. update submodule (name_of_submodule)'
|
|
|
git push <remote branch name>
|
|
|
```
|
|
|
Now, the submodule structure on the main repository is synchronized again with your latest commit.
|
|
|
This push of the main repository has not done any changes to the submodules (which have already been pushed in the last step) -- it has merely updated the submodule structure in a way to point to the
|
|
|
|
|
|
|
|
|
|