git-annex/ git-annex-lookupkey

# NAME

git-annex lookupkey - looks up key used for file

# SYNOPSIS

git annex lookupkey `[file ...]`

# DESCRIPTION

This plumbing-level command looks up the key used for a file in the index. The key is output to stdout. If there is no key (because the file is not present in the index, or is not a git-annex managed file), nothing is output, and it exits nonzero.

# OPTIONS

- `--ref`

  Rather than looking for the specified files in the index, interpet them as git refs. For example to find the key used for somefile in tag v1.0:

  git-annex lookupkey v1.0:somefile

- `--batch`

  Enable batch mode, in which a line containing the filename is read from stdin, the key is output to stdout (with a trailing newline), and repeat.

  Note that if there is no key corresponding to the file, an empty line is output to stdout instead.

- `-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

git-annex(1)

# AUTHOR

Joey Hess id@joeyh.name

Warning: Automatically converted into a man page by mdwn2man. Edit with care.

comment 2

git-annex has several global options that are documented in the main git-annex man page.

Comment by joey — Wed Oct 29 14:05:27 2025
Options don't match git-annex lookupkey --help

The options in this man page don't quite match what shows up with git-annex lookupkey --help. `--help` seems to include a lot of options that are non-sensicle in the context of lookup key.

> % git-annex lookupkey --help git-annex lookupkey - looks up key used for file

> Usage: git-annex lookupkey [--batch] [-z] [FILE ...]

> Available options: --batch enable batch mode -z null delimited batch input --force allow actions that may lose annexed data -F,--fast avoid slow operations -q,--quiet avoid verbose output -v,--verbose allow verbose output (default) -d,--debug show debug messages --no-debug don't show debug messages -b,--backend NAME specify key-value backend to use -N,--numcopies NUMBER override default number of copies --trust REMOTE override trust setting --semitrust REMOTE override trust setting back to default --untrust REMOTE override trust setting to untrusted -c,--config NAME=VALUE override git configuration setting --user-agent NAME override default User-Agent --trust-glacier Trust Amazon Glacier inventory --notify-finish show desktop notification after transfer finishes --notify-start show desktop notification after transfer starts -h,--help Show this help text

> For details, run: git-annex help lookupkey % git-annex version git-annex version: 7.20190322-gbc302b56a build flags: S3(multipartupload)(storageclasses) TorrentParser Feeds Testsuite dependency versions: aws-0.21.1 bloomfilter-2.0.1.0 cryptonite-0.25 feed-1.0.1.0 ghc-8.6.3 http-client-0.6.2 persistent-sqlite-2.9.2 torrent-10000.1.1 uuid-1.3.13 key/value backends: SHA256E SHA256 SHA512E SHA512 SHA224E SHA224 SHA384E SHA384 SHA3_256E SHA3_256 SHA3_512E SHA3_512 SHA3_224E SHA3_224 SHA3_384E SHA3_384 SKEIN256E SKEIN256 SKEIN512E SKEIN512 BLAKE2B256E BLAKE2B256 BLAKE2B512E BLAKE2B512 BLAKE2B160E BLAKE2B160 BLAKE2B224E BLAKE2B224 BLAKE2B384E BLAKE2B384 BLAKE2S256E BLAKE2S256 BLAKE2S160E BLAKE2S160 BLAKE2S224E BLAKE2S224 BLAKE2SP256E BLAKE2SP256 BLAKE2SP224E BLAKE2SP224 SHA1E SHA1 MD5E MD5 WORM URL remote types: git gcrypt p2p S3 bup directory rsync web bittorrent adb tahoe glacier ddar hook external operating system: dragonfly x86_64 supported repository versions: 5 7 upgrade supported from repository versions: 0 1 2 3 4 5 6 local repository version: 5

Comment by driusan — Wed Oct 29 14:05:27 2025
Comments on this page are closed.