1git-annex-add(1) General Commands Manual git-annex-add(1)
2
3
4
6 git-annex-add - adds files to the git annex
7
9 git annex add [path ...]
10
12 Adds the specified files to the annex. If a directory is specified,
13 acts on all files inside the directory and its subdirectories. If no
14 path is specified, adds files from the current directory and below.
15
16 Files that are already checked into git and are unmodified, or that git
17 has been configured to ignore will be silently skipped.
18
19 If annex.largefiles is configured (in git config, gitattributes, or
20 git-annex config), and does not match a file, git annex add will behave
21 the same as git add and add the non-large file directly to the git
22 repository, instead of to the annex. (By default dotfiles are assumed
23 to not be large, and are added directly to git, but annex.dotfiles can
24 be configured to annex those too.) See the git-annex manpage for docu‐
25 mentation of these and other configuration settings.
26
27 By default, large files are added to the annex in locked form, which
28 prevents further modification of their content until unlocked by git-
29 annex-unlock(1). (This is not the case however when a repository is in
30 a filesystem not supporting symlinks.) The annex.addunlocked git con‐
31 fig (and git-annex config) can be used to change this behavior.
32
33 This command can also be used to add symbolic links, both symlinks to
34 annexed content, and other symlinks.
35
37 # git annex add foo bar
38 add foo ok
39 add bar ok
40 # git commit -m added
41
43 --no-check-gitignore
44
45 Add gitignored files.
46
47 --force-large
48 Treat all files as large files, ignoring annex.largefiles and
49 annex.dotfiles configuration, and add to the annex.
50
51 --force-small
52 Treat all files as small files, ignoring annex.largefiles and
53 annex.dotfiles and annex.addsmallfiles configuration, and add to
54 git.
55
56 --backend
57 Specifies which key-value backend to use.
58
59 file matching options
60 Many of the git-annex-matching-options(1) can be used to specify
61 files to add.
62
63 For example: --largerthan=1GB
64
65 --jobs=N -JN
66 Adds multiple files in parallel. This may be faster. For exam‐
67 ple: -J4
68
69 Setting this to "cpus" will run one job per CPU core.
70
71 --update -u
72 Like git add --update, this does not add new files, but any up‐
73 dates to tracked files will be added to the index.
74
75 --dry-run
76 Output what would be done for each file, but avoid making any
77 changes.
78
79 --json Enable JSON output. This is intended to be parsed by programs
80 that use git-annex. Each line of output is a JSON object.
81
82 --json-progress
83 Include progress objects in JSON output.
84
85 --json-error-messages
86 Messages that would normally be output to standard error are in‐
87 cluded in the JSON instead.
88
89 --batch
90 Enables batch mode, in which a file to add is read in a line
91 from stdin, the file is added, and repeat.
92
93 Note that if a file is skipped (due to not existing, being git‐
94 ignored, already being in git, or doesn't meet the matching op‐
95 tions), an empty line will be output instead of the normal out‐
96 put produced when adding a file.
97
98 -z Makes the --batch input be delimited by nulls instead of the
99 usual newlines.
100
101 Also the git-annex-common-options(1) can be used.
102
104 git-annex(1)
105
106 git-annex-unlock(1)
107
108 git-annex-lock(1)
109
110 git-annex-undo(1)
111
112 git-annex-import(1)
113
114 git-annex-unannex(1)
115
116 git-annex-reinject(1)
117
119 Joey Hess <id@joeyh.name>
120
121 git-annex-add(1)