1git-annex-matching-options(1)General Commands Manuaglit-annex-matching-options(1)
2
3
4
6 git-annex-matching-options - specifying files to act on
7
9 Many git-annex commands support using these options to specify which
10 files they act on.
11
12 Arbitrarily complicated expressions can be built using these options.
13 For example:
14
15 --include='*.mp3' --and -( --in=usbdrive --or --in=archive -)
16
17 The above example makes git-annex work on only mp3 files that are
18 present in either of two repositories.
19
21 --exclude=glob
22
23 Skips files matching the glob pattern. The glob is matched rela‐
24 tive to the current directory. For example:
25
26 --exclude='*.mp3' --exclude='subdir/*'
27
28 Note that this will not match anything when using --all or
29 --unused.
30
31 --include=glob
32 Skips files not matching the glob pattern. (Same as --not
33 --exclude.) For example, to include only mp3 and ogg files:
34
35 --include='*.mp3' --or --include='*.ogg'
36
37 Note that this will not skip anything when using --all or
38 --unused.
39
40 --in=repository
41 Matches only files that git-annex believes have their contents
42 present in a repository. Note that it does not check the reposi‐
43 tory to verify that it still has the content.
44
45 The repository should be specified using the name of a config‐
46 ured remote, or the UUID or description of a repository. For the
47 current repository, use --in=here
48
49 --in=repository@{date}
50 Matches files currently in the work tree whose content was
51 present in the repository on the given date.
52
53 The date is specified in the same syntax documented in gitrevi‐
54 sions(7). Note that this uses the reflog, so dates far in the
55 past cannot be queried.
56
57 For example, you might need to run git annex drop . to temporar‐
58 ily free up disk space. The next day, you can get back the files
59 you dropped using git annex get . --in=here@{yesterday}
60
61 --copies=number
62 Matches only files that git-annex believes to have the specified
63 number of copies, or more. Note that it does not check remotes
64 to verify that the copies still exist.
65
66 --copies=trustlevel:number
67 Matches only files that git-annex believes have the specified
68 number of copies, on remotes with the specified trust level. For
69 example, --copies=trusted:2
70
71 To match any trust level at or higher than a given level, use
72 'trustlevel+'. For example, --copies=semitrusted+:2
73
74 --copies=groupname:number
75 Matches only files that git-annex believes have the specified
76 number of copies, on remotes in the specified group. For exam‐
77 ple, --copies=archive:2
78
79 --lackingcopies=number
80 Matches only files that git-annex believes need the specified
81 number or more additional copies to be made in order to satisfy
82 their numcopies settings.
83
84 --approxlackingcopies=number
85 Like lackingcopies, but does not look at .gitattributes
86 annex.numcopies settings. This makes it significantly faster.
87
88 --inbackend=name
89 Matches only files whose content is stored using the specified
90 key-value backend.
91
92 --securehash
93 Matches only files whose content is hashed using a cryptographi‐
94 cally secure function.
95
96 --inallgroup=groupname
97 Matches only files that git-annex believes are present in all
98 repositories in the specified group.
99
100 --smallerthan=size
101
102 --largerthan=size
103 Matches only files whose content is smaller than, or larger than
104 the specified size.
105
106 The size can be specified with any commonly used units, for
107 example, "0.5 gb" or "100 KiloBytes"
108
109 --metadata field=glob
110 Matches only files that have a metadata field attached with a
111 value that matches the glob. The values of metadata fields are
112 matched case insensitively.
113
114 --metadata field<number / --metadata field>number
115
116 --metadata field<=number / --metadata field>=number
117 Matches only files that have a metadata field attached with a
118 value that is a number and is less than or greater than the
119 specified number.
120
121 (Note that you will need to quote the second parameter to avoid
122 the shell doing redirection.)
123
124 --want-get
125 Matches files that the preferred content settings for the repos‐
126 itory make it want to get. Note that this will match even files
127 that are already present, unless limited with e.g., --not --in .
128
129 Note that this will not match anything when using --all or
130 --unused.
131
132 --want-drop
133 Matches files that the preferred content settings for the repos‐
134 itory make it want to drop. Note that this will match even files
135 that have already been dropped, unless limited with e.g., --in .
136
137 Note that this will not match anything when using --all or
138 --unused.
139
140 --accessedwithin=interval
141 Matches files that were accessed recently, within the specified
142 time interval.
143
144 The interval can be in the form "5m" or "1h" or "2d" or "1y", or
145 a combination such as "1h5m".
146
147 So for example, --accessedwithin=1d matches files that have been
148 accessed within the past day.
149
150 If the OS or filesystem does not support access times, this will
151 not match any files.
152
153 --unlocked
154 Matches annexed files that are unlocked.
155
156 --locked
157 Matches annexed files that are locked.
158
159 --mimetype=glob
160 Looks up the MIME type of a file, and checks if the glob matches
161 it.
162
163 For example, --mimetype="text/*" will match many varieties of
164 text files, including "text/plain", but also
165 "text/x-shellscript", "text/x-makefile", etc.
166
167 The MIME types are the same that are displayed by running file
168 --mime-type
169
170 If the file's annexed content is not present, the file will not
171 match.
172
173 This is only available to use when git-annex was built with the
174 MagicMime build flag.
175
176 --mimeencoding=glob
177 Looks up the MIME encoding of a file, and checks if the glob
178 matches it.
179
180 For example, --mimeencoding=binary will match many kinds of
181 binary files.
182
183 The MIME encodings are the same that are displayed by running
184 file --mime-encoding
185
186 If the file's annexed content is not present, the file will not
187 match.
188
189 This is only available to use when git-annex was built with the
190 MagicMime build flag.
191
192 --not Inverts the next matching option. For example, to only act on
193 files with less than 3 copies, use --not --copies=3
194
195 --and Requires that both the previous and the next matching option
196 matches. The default.
197
198 --or Requires that either the previous, or the next matching option
199 matches.
200
201 -( Opens a group of matching options.
202
203 -) Closes a group of matching options.
204
206 git-annex(1)
207
209 Joey Hess <id@joeyh.name>
210
211 git-annex-matching-options(1)