git-annex-add(1)
๐ 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 theannex.largefilesandannex.dotfilesconfiguration, and adds them to the annex.--force-smallโ treats all files as small files, ignoringannex.largefilesandannex.dotfilesandannex.addsmallfilesconfiguration, 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โ likegit 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--batchinput be delimited by nulls instead of the usual newlines.
Also the git-annex-common-options(1) can be used. ๐ซถ
๐ SEE ALSO ๐
git-annex(1)git-annex-unlock(1)git-annex-lock(1)git-annex-undo(1)git-annex-import(1)git-annex-unannex(1)git-annex-reinject(1)
๐ 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 ๐ ๐งโโ๏ธ
๐ฆ where this page comes from
- alpine 3.24: git-annex-doc 10.20261026-r0 ยท AGPL-3.0-or-later
- arch rolling: git-annex 10.20261026-2 ยท AGPL-3.0-only
- debian trixie: git-annex 10.20250416-2 ยท AGPL-3.0-or-later
- debian trixie: git-annex 10.20250416-2+deb13u1 ยท AGPL-3.0-or-later
- epel 10: git-annex 10.20250320-1.el10_0 ยท AGPL-3.0-or-later
- fedora 43: git-annex 10.20250630-4.fc43 ยท AGPL-3.0-or-later
- fedora 43: git-annex 10.20250929-5.fc43 ยท AGPL-3.0-or-later
- fedora 44: git-annex 10.20260115-1.fc44 ยท AGPL-3.0-or-later
- nixos 26.05: git-annex 10.20260421
- nixpkgs unstable: git-annex 10.20260421
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 ยท AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 ยท AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 ยท AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- ubuntu questing: git-annex 10.20250721-1
- ubuntu resolute: git-annex 10.20251029-1ubuntu1 ยท AGPL-3.0-or-later
- ubuntu stonking: git-annex 10.20251029-1ubuntu1 ยท AGPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms