notes.txt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. One can create a new dataset with 'datalad create [--description] PATH'.
  2. The dataset is created empty
  3. The command "datalad save [-m] PATH" saves the file
  4. (modifications) to history. Note to self:
  5. Always use informative, concise commit messages.
  6. The command 'datalad clone URL/PATH [PATH]'
  7. clones a dataset from e.g., a URL or a path.
  8. If you clone a dataset into an existing
  9. dataset (as a subdataset), remember to specify the
  10. root of the superdataset with the '-d' option.
  11. There are two useful functions to display changes between two
  12. states of a dataset: "datalad diff -f/--from COMMIT -t/--to COMMIT"
  13. and "git diff COMMIT COMMIT", where COMMIT is a shasum of a commit
  14. in the history.
  15. The datalad run command can record the impact a script or command has on a Dataset.
  16. In its simplest form, datalad run only takes a commit message and the command that
  17. should be executed.
  18. Any datalad run command can be re-executed by using its commit shasum as an argument
  19. in datalad rerun CHECKSUM. DataLad will take information from the run record of the original
  20. commit, and re-execute it. If no changes happen with a rerun, the command will not be written
  21. to history. Note: you can also rerun a datalad rerun command!
  22. You should specify all files that a command takes as input with an -i/--input flag. These
  23. files will be retrieved prior to the command execution. Any content that is modified or
  24. produced by the command should be specified with an -o/--output flag. Upon a run or rerun
  25. of the command, the contents of these files will get unlocked so that they can be modified.
  26. Important! If the dataset is not "clean" (a datalad status output is empty),
  27. datalad run will not work - you will have to save modifications present in your
  28. dataset.
  29. A suboptimal alternative is the --explicit flag,
  30. used to record only those changes done
  31. to the files listed with --output flags.
  32. A source to clone a dataset from can also be a path,
  33. for example as in "datalad clone ../DataLad-101".
  34. Just as in creating datasets, you can add a
  35. description on the location of the new dataset clone
  36. with the -D/--description option.
  37. Note that subdatasets will not be installed by default,
  38. but are only registered in the superdataset -- you will
  39. have to do a "datalad get -n PATH/TO/SUBDATASET"
  40. to clone the subdataset for file availability meta data.
  41. The -n/--no-data options prevents that file contents are
  42. also downloaded.
  43. Note that a recursive "datalad get" would clone all further
  44. registered subdatasets underneath a subdataset, so a safer
  45. way to proceed is to set a decent --recursion-limit:
  46. "datalad get -n -r --recursion-limit 2 <subds>"