.. The content of this file was auto-generated by your mad uncle from Germany using the cast2rst script and a recorded asciicast as input. Do not edit this file! DataLad provides seamless management of nested Git repositories... Let's create a dataset .. code-block:: ansi-color ~ % datalad create demo [INFO ] Creating a new annex repo at /demo/demo create(ok): /demo/demo (dataset) ~ % cd demo A DataLad dataset is just a Git repo with some initial configuration .. code-block:: ansi-color ~/demo % git log --oneline 472e34b (HEAD -> master) [DATALAD] new dataset f968257 [DATALAD] Set default backend for all files to be MD5E We can generate nested datasets, by telling DataLad to register a new dataset in a parent dataset .. code-block:: ansi-color ~/demo % datalad create -d . sub1 [INFO ] Creating a new annex repo at /demo/demo/sub1 add(ok): sub1 (dataset) [added new subdataset] add(notneeded): sub1 (dataset) [nothing to add from /demo/demo/sub1] add(notneeded): .gitmodules (file) [already included in the dataset] save(ok): /demo/demo (dataset) create(ok): sub1 (dataset) action summary: add (notneeded: 2, ok: 1) create (ok: 1) save (ok: 1) A subdataset is nothing more than regular Git submodule .. code-block:: ansi-color ~/demo % git submodule 5f0cddf2026e3fb4864139f27e7415fd72c7d4d0 sub1 (heads/master) Of course subdatasets can be nested .. code-block:: ansi-color ~/demo % datalad create -d . sub1/justadir/sub2 [INFO ] Creating a new annex repo at /demo/demo/sub1/justadir/sub2 add(ok): sub1/justadir/sub2 (dataset) [added new subdataset] add(notneeded): sub1/justadir/sub2 (dataset) [nothing to add from /demo/demo/sub1/justadir/sub2] add(notneeded): sub1/.gitmodules (file) [already included in the dataset] add(notneeded): sub1 (dataset) [already known subdataset] save(ok): /demo/demo/sub1 (dataset) save(ok): /demo/demo (dataset) create(ok): sub1/justadir/sub2 (dataset) action summary: add (notneeded: 3, ok: 1) create (ok: 1) save (ok: 2) Unlike Git, DataLad automatically takes care of committing all changes associated with the added subdataset up to the given parent dataset .. code-block:: ansi-color ~/demo % git status On branch master nothing to commit, working tree clean Let's create some content in the deepest subdataset .. code-block:: ansi-color ~/demo % mkdir sub1/justadir/sub2/anotherdir ~/demo % touch sub1/justadir/sub2/anotherdir/afile Git can only tell us that something underneath the top-most subdataset was modified .. code-block:: ansi-color ~/demo % git status On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) (commit or discard the untracked or modified content in submodules) modified: sub1 (untracked content) no changes added to commit (use "git add" and/or "git commit -a") DataLad saves us from further investigation .. code-block:: ansi-color ~/demo % datalad diff -r modified(dataset): sub1 modified(dataset): sub1/justadir/sub2 untracked(directory): sub1/justadir/sub2/anotherdir Like Git, it can report individual untracked files, but also across repository boundaries .. code-block:: ansi-color ~/demo % datalad diff -r --report-untracked all modified(dataset): sub1 modified(dataset): sub1/justadir/sub2 untracked(file): sub1/justadir/sub2/anotherdir/afile Adding this new content with Git or git-annex would be an exercise .. code-block:: ansi-color ~/demo % git add sub1/justadir/sub2/anotherdir/afile fatal: Pathspec 'sub1/justadir/sub2/anotherdir/afile' is in submodule 'sub1' DataLad does not require users to determine the correct repository in the tree .. code-block:: ansi-color ~/demo % datalad add -d . sub1/justadir/sub2/anotherdir/afile add(ok): sub1/justadir/sub2/anotherdir/afile (file) save(ok): /demo/demo/sub1/justadir/sub2 (dataset) save(ok): /demo/demo/sub1 (dataset) save(ok): /demo/demo (dataset) action summary: add (ok: 1) save (ok: 3) Again, all associated changes in the entire dataset tree, up to the given parent dataset, were committed .. code-block:: ansi-color ~/demo % git status On branch master nothing to commit, working tree clean DataLad's 'diff' is able to report the changes from these related commits throughout the repository tree .. code-block:: ansi-color ~/demo % datalad diff --revision @~1 -r modified(dataset): sub1 modified(dataset): sub1/justadir/sub2 added(file): sub1/justadir/sub2/anotherdir/afile _____________________________________ / Demo was using datalad 0.9.2.dev1. \ \ Discover more at http://datalad.org / ------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || .. code-block:: ansi-color ~/demo % exit