git-annex/doc/git-annex-fromkey.mdwn
Joey Hess b184fc490a
split out common options to its own page and mention it on each subcommand page
Sometimes users would get confused because an option they were looking
for was not mentioned on a subcommand's man page, and they had not
noticed that the main git-annex man page had a list of common options.
This change lets each subcommand mention the common options, similarly
to how the matching options are handled.

This commit was sponsored by Svenne Krap on Patreon.
2021-05-10 15:00:13 -04:00

60 lines
1.5 KiB
Markdown

# NAME
git-annex fromkey - adds a file using a specific key
# SYNOPSIS
git annex fromkey `[key file ...]`
# DESCRIPTION
This plumbing-level command can be used to manually set up a file
in the git repository to link to a specified key.
Multiple pairs of file and key can be given in a single command line.
If no key and file pair are specified on the command line, batch input
is used, the same as if the --batch option were specified.
Normally the key is a git-annex formatted key. However, to make it easier
to use this to add urls, if the key cannot be parsed as a key, and is a
valid url, an URL key is constructed from the url. Note that this does not
register the url as a location of the key; use [[git-annex-registerurl]](1)
to do that.
# OPTIONS
* `--force`
Allow making a file link to a key whose content is not in the local
repository. The key may not be known to git-annex at all.
* `--batch`
In batch input mode, lines are read from stdin, and each line
should contain a key and filename, separated by a single space.
* `-z`
When in batch mode, the input is delimited by nulls instead of the usual
newlines.
(Note that for this to be used, you have to explicitly enable batch mode
with `--batch`)
* `--json`
Enable JSON output. This is intended to be parsed by programs that use
git-annex. Each line of output is a JSON object.
* 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.