Skip to content

Commit d4ca2f0

Browse files
committed
suggestion for submodule example
1 parent 32aac04 commit d4ca2f0

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,32 @@ on its remote repository and then merge those locally.
327327
git submodule update --remote --merge
328328
```
329329

330-
Remember that updates to submodules need to be commited as well.
330+
Remember that updates to submodules need to be committed as well.
331+
332+
#### Example for submodule usage
333+
334+
So say you want to clone a repo that has some nested submodules, then you would type this to get the content of all the submodules at once (here with assumption that you want to clone my experiment repo):
335+
``` bash
336+
git clone --recurse-submodules https://github.com/user_name/myExperiment.git
337+
```
338+
This would be the way to do it fast way.
339+
340+
To do it in more controlled/slow motion, see below
341+
```bash
342+
# clone the repo
343+
git clone https://github.com/user_name/myExperiment.git
344+
345+
# go into the directory
346+
cd myExperiment
347+
348+
# initialize and get the content of the first level of submodules (e.g. CPP_PTB and CPP_BIDS)
349+
git submodule init
350+
git submodule update
351+
352+
# get the nested submodules JSONio and BIDS-matlab for CPP_BIDS
353+
git submodule foreach --recursive 'git submodule init'
354+
git submodule foreach --recursive 'git submodule update'
355+
```
331356

332357
**TO DO**
333358
<!-- Submodules

0 commit comments

Comments
 (0)