datalad-handbook/docs/basics/_examples/DL-101-121-109
2025-03-13 08:20:26 +01:00

78 lines
2.4 KiB
Text

$ git diff remotes/roommate/main
diff --git a/code/nested_repos.sh b/code/nested_repos.sh
deleted file mode 100644
index f84c817..0000000
--- a/code/nested_repos.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-# This script was converted using cast2script from:
-# docs/casts/seamless_nested_repos.sh
-set -e -u
-export GIT_PAGER=cat
-
-# DataLad provides seamless management of nested Git repositories...
-
-# Let's create a dataset
-datalad create demo
-cd demo
-
-# A DataLad dataset is just a Git repo with some initial configuration
-git log --oneline
-
-# We can generate nested datasets, by telling DataLad to register a
-# new dataset in a parent dataset
-datalad create -d . sub1
-
-# A subdataset is nothing more than regular Git submodule
-git submodule
-
-# Of course subdatasets can be nested
-datalad create -d . sub1/justadir/sub2
-
-# Unlike Git, DataLad automatically takes care of committing all
-# changes associated with the added subdataset up to the given
-# parent dataset
-git status
-
-# Let's create some content in the deepest subdataset
-mkdir sub1/justadir/sub2/anotherdir
-touch sub1/justadir/sub2/anotherdir/afile
-
-# Git can only tell us that something underneath the top-most
-# subdataset was modified
-git status
-
-# DataLad saves us from further investigation
-datalad diff -r
-
-# Like Git, it can report individual untracked files, but also across
-# repository boundaries
-datalad diff -r --report-untracked all
-
-# Adding this new content with Git or git-annex would be an exercise
-git add sub1/justadir/sub2/anotherdir/afile || true
-
-# DataLad does not require users to determine the correct repository
-# in the tree
-datalad add -d . sub1/justadir/sub2/anotherdir/afile
-
-# Again, all associated changes in the entire dataset tree, up to
-# the given parent dataset, were committed
-git status
-
-# DataLad's 'diff' is able to report the changes from these related
-# commits throughout the repository tree
-datalad diff --revision @~1 -r
diff --git a/notes.txt b/notes.txt
index c302a3c..1c681e5 100644
--- a/notes.txt
+++ b/notes.txt
@@ -59,3 +59,7 @@ The command "git annex whereis PATH" lists the repositories that have
the file content of an annexed file. When using "datalad get" to
retrieve file content, those repositories will be queried.
+To update a shared dataset, run the command "datalad update --how merge".
+This command will query its origin for changes, and integrate the
+changes into the dataset.
+