Annexed files
The Basics

Git versus Git-annex

Data in datasets is either stored in Git or git-annex
By default, everything is annexed, i.e. stored in a dataset annex


Git git-annex
handles small files well (text, code) handles all types and sizes of files well
file contents are in the Git history and will be shared upon git/datalad push file contents are in the annex. Not necessarily shared
Shared with every dataset clone Can be kept private on a per-file level when sharing the dataset
Useful: Small, non-binary, frequently modified, need-to-be-accessible (DUA, README) files Useful: Large files, private files


Git versus Git-annex

More details in this handbook chapter.
Git and git-annex handle files differently: Annexed contents are retrieved on demand, files in Git are downloaded during clone. Files stored in Git are modifiable, annexed files are write-protected.
  • Annexed contents are hashed, moved to .git/annex/objects and symlinked.
  • Git versions the symlink (content-identity), not the content.
  • Content is "locked" (write-protected) against accidental modifications.
  • Content identity and availability information of annexed files are available after cloning to get file contents. Content changes are immediately transparent.

Annexed files on Windows

Windows' file system does not support symlinks. Under these conditions, git-annex automatically operates in "adjusted unlocked mode":
  • File contents are duplicated: One copy to edit, one to keep safe.
  • File contents are always modifiable.
  • Trade-off: disk space use, vs easy modification.
    • Annexed files are pointer files instead of symlinks: A text file with the contents "/annex/objects/" followed by the key.
    • Git annex uses "adjusted branches, which unlock on top the locked counterpart branch. Compatibility with other systems but confusing Git log and issues in some nesting usecases.