git-annex/ git-annex-checkpresentkey

# NAME

git-annex checkpresentkey - check if key is present in remote

# SYNOPSIS

git annex checkpresentkey `key` `[remote]`

# DESCRIPTION

This plumbing-level command verifies if the specified key's content is present in the specified remote.

When no remote is specified, it verifies if the key's content is present in any accessible remotes.

Exits 0 if the content is verified present in the remote, or 1 if it is verified to not be present in the remote. If there is a problem, the special exit code 100 is used, and an error message is output to stderr.

# OPTIONS

- `--batch`

  Enables batch mode. In this mode, the `key` is not specified at the command line, but the `remote` may still be. Lines containing keys are read from stdin, and a line is output with "1" if the key is verified to be present, and "0" otherwise.

- 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

It makes sense that checkpresentkey could report different information than whereis, because whereis only reports on logged location information, while checkpresentkey actively checks the remote.

I'm not entirely clear on how an external special remote could not support checkpresent, I suppose you might mean it always fails or is just not implemented (so basically fails). That would be a problem with the remote's implementation. If it's something else, open a bug report.

Comment by joey — Tue Jul 22 18:11:47 2025
comment 1
If a key has a URL by which it can be downloaded from an external special remote, and the remote supports checkurl but not checkpresent, checkpresentkey says the key isn't in the remote; but git annex whereis --key says there is. Maybe it's as intended, checkpresentkey being a plumbing command, but just wanted to note.
Comment by Ilya_Shlyakhter — Tue Jul 22 18:11:47 2025
Comments on this page are closed.