git-annex-...-expression(1)

πŸ“¦
version 10.20261026 Β· 2 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

✨ NAME ✨</p>

git-annex-matching-expression β€” specifying a set of files πŸ’–

so like… the manual page here is git-annex-...-expression(1), from the General Commands Manual, and it's about picking out which files match πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay bestie, listen. Both the annex.largefiles and annex.addunlocked configs use expressions that match some files in the working tree. That's the whole vibe of this page β€” teaching you the language of those expressions so you can tell git-annex exactly which files you mean. πŸ’…


🌸 SYNTAX 🌸

The format of these expressions is similar to git-annex-preferred-content(1) expressions. iykyk πŸ‘‘

For example:

largerthan=100kb and not (include=*.c or include=*.h)

This matches large files, but excludes C source files. iconic behaviour, honestly ✨

The following terms can be used:

  • include=glob / exclude=glob β€” Specify files to include or exclude. πŸ’–
    • The glob can contain * and ? to match arbitrary characters.
    • Note that this matches on the whole filename, relative to the top of the git directory. So, include=foo will include a file foo in the top, but not subdir/foo. To include both, use include=foo or include=*/foo 🫢
  • smallerthan=size / largerthan=size β€” Matches only files smaller than, or larger than the specified size.
    • The size can be specified with any commonly used units, for example, "0.5 gb" or "100 KiloBytes" 🌈
  • mimetype=glob β€” Looks up the MIME type of a file, and checks if the glob matches it. πŸ”₯
    • For example, "mimetype=text/*" will match many varieties of text files, including "text/plain", but also "text/x-shellscript", "text/x-makefile", etc.
    • The MIME types are the same that are displayed by running file --mime-type
    • > ⚠️ This only matches when the content of the file is present in the local repository. Usually that is the case, but eg, when importing from a special remote with --no-content, the content is usually not present. not me finding out the hard way 😭
    • > πŸ’€ This is only available to use when git-annex was built with the MagicMime build flag.
  • mimeencoding=glob β€” Looks up the MIME encoding of a file, and checks if the glob matches it. πŸ“
    • For example, "mimeencoding=binary" will match many kinds of binary files.
    • The MIME encodings are the same that are displayed by running file --mime-encoding
    • > ⚠️ This only matches when the content of the file is present in the local repository. Usually that is the case, but eg, when importing from a special remote with --no-content, the content is usually not present.
    • > πŸ’€ This is only available to use when git-annex was built with the MagicMime build flag.
  • anything β€” Matches any file. main character energy, matches literally everything πŸ’…
  • nothing β€” Matches no files. (Same as "not anything") πŸ«₯
  • not expression β€” Inverts what the expression matches. πŸ™ˆ
  • and / or / ( expression ) β€” These can be used to build up more complicated expressions. nesting time, bestie 🧚

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Joey Hess <id@joeyh.name>

<http://git-annex.branchable.com/>


and that's the whole page, bestie β€” it's git-annex-...-expression(1) from the General Commands Manual, signed off with all the love in the world πŸŽ€βœ¨ go forth and match some files, you've got this fr fr πŸ’–