git-annex-add(1)

๐Ÿ“ฆ
version 10.20261026 ยท 4 versions
, in alpine 3.24, arch rolling, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– git-annex-add โ€” the "put ur files in the annex bestie" manual โœจ

okay so this is git-annex-add(1) from the General Commands Manual, and honestly? it's giving "let's get ur files comfy in the annex" energy. sit down, grab a snack ๐Ÿ“, we're doing this.


๐ŸŒธ NAME ๐ŸŒธ

git-annex-add โ€” adds files to the git annex. yes. that's the whole vibe. adding files. to the annex. iconic.


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

git annex add [path ...]

โœจ DESCRIPTION โœจ

So here's the tea ๐Ÿซ–: this command adds the files you point at into the annex. Point it at a directory and it'll act on every file inside that directory and all its subdirectories, like it's doing a lil sweep of the whole place. Don't give it any path at all? No worries, it just adds files from the current directory and everything below it. lowkey convenient.

Files that are already checked into git and are unmodified, or files that git has been configured to ignore, get silently skipped. no drama, no message, just skipped. ๐Ÿ’€

Now, if annex.largefiles is configured โ€” and that can live in git config, gitattributes, or git-annex config โ€” and a file doesn't match it, then git annex add acts exactly like git add and adds that non-large file directly to the git repository, not to the annex. (By default, dotfiles and the contents of dotdirs are assumed to not be large, and are added directly to git โ€” but annex.dotfiles can be configured to annex those too, if that's ur thing.) See the git-annex manpage for the documentation of these and other configuration settings. ๐Ÿ“š

By default, large files get added to the annex in locked form ๐Ÿ”’, which stops you from modifying their content any further until you unlock them with git-annex-unlock(1). (This is not the case however when a repository is in a filesystem that doesn't support symlinks โ€” noted!!) The annex.addunlocked git config (and git-annex config) can be used to change this behavior.

And plot twist: this command can also add symbolic links โ€” both symlinks to annexed content, and other symlinks. versatile queen ๐Ÿ‘‘


๐ŸŽ€ EXAMPLES ๐ŸŽ€

watch and learn:

# git annex add foo bar
add foo ok
add bar ok
# git commit -m added

ate. no crumbs. ๐Ÿ’…


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • --no-check-gitignore โ€” adds gitignored files. yeah, we're going there. ๐Ÿ™ˆ
  • --force-large โ€” treats all files as large files, ignoring the annex.largefiles and annex.dotfiles configuration, and adds them to the annex.
  • --force-small โ€” treats all files as small files, ignoring annex.largefiles and annex.dotfiles and annex.addsmallfiles configuration, and adds them to git.
  • --backend โ€” specifies which key-value backend to use.
  • file matching options โ€” many of the git-annex-matching-options(1) can be used to specify files to add.

For example: --largerthan=1GB

  • --jobs=N -JN โ€” adds multiple files in parallel. This may be faster. For example: -J4

Setting this to "cpus" will run one job per CPU core. โšก

  • --update -u โ€” like git add --update, this does not add new files, but any updates to tracked files will be added to the index.
  • --dry-run โ€” output what would be done for each file, but avoid making any changes. just vibes, no consequences. ๐Ÿ”ฎ
  • --json โ€” enable JSON output. This is intended to be parsed by programs that use git-annex. Each line of output is a JSON object.
  • --json-progress โ€” include progress objects in JSON output.
  • --json-error-messages โ€” messages that would normally be output to standard error are included in the JSON instead.
  • --batch โ€” enables batch mode, in which a file to add is read in a line from stdin, the file is added, and repeat. ๐Ÿ”

Note that if a file is skipped (due to not existing, being gitignored, already being in git, or doesn't meet the matching options), an empty line will be output instead of the normal output produced when adding a file. don't be confused bestie, that's on purpose.

  • -z โ€” makes the --batch input be delimited by nulls instead of the usual newlines.

Also the git-annex-common-options(1) can be used. ๐Ÿซถ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Joey Hess <id@joeyh.name> โ€” the actual main character, no cap. ๐Ÿ‘‘


and that's the whole page bestie!! ๐Ÿ’– the footer at the very bottom is just git-annex-add(1) โ€” same as the title, no version number, no date, nothing extra. it's a lil minimalist moment. we love that for it. โœจ

okay bye go add ur files ๐Ÿ’…๐Ÿงšโ€โ™€๏ธ