git-annex-copy(1)

πŸ’… NAME

git-annex-copy β€” copy the content of files to/from another repository 🫢


✨ SYNOPSIS ✨

git annex copy [path ...] [--from=remote|--to=remote]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so bestie, here's the vibe: this command copies the content of files from or to another repository. That's it, that's the whole gig. Iconic, lowkey.

If you give it no parameters at all, it just operates on all annexed files in the current directory (main character behavior, honestly). But you can also point it at specific files or directories if you want to be picky β€” paths of files or directories to operate on can be specified. Slay.


🌸 OPTIONS 🌸

  • --from=remote β€” Copies the content of files from the specified remote into the local repository. Heads up though: any files that are not available on the remote will be silently skipped πŸ™ˆ like they simply didn't show up to the party.
  • --to=remote β€” Copies the content of files from the local repository to the specified remote.
  • --to=here β€” Copies the content of files from all reachable remotes into the local repository. Everything, everywhere, all at once πŸŒ€
  • --from=remote1 --to=remote2 β€” Copies the content of files that are in remote1 over to remote2. The way this actually works: it first downloads the content from remote1 to the local repository (if it's not already there), then sends it to remote2, and then deletes the content from the local repository if it was not present to start with. So it's giving middleman, but make it tidy πŸ’…
  • --from-anywhere --to=remote β€” Copies files to the remote from the local repository as well as from any reachable remotes. Best of both worlds, no cap.
  • --jobs=N -JN β€” Enables parallel transfers with up to the specified number of jobs running at once. For example: -J10 πŸƒβ€β™€οΈπŸ’¨

Setting this to "cpus" will run one job per CPU core.

Note that when using --from with --to, twice this many jobs will run at once, evenly split between the two remotes. Double the chaos, double the fun.

  • --wanted -w β€” Rather than copying all specified files, only copy those that are preferred content of the destination repository. See git-annex-preferred-content(1) for the whole lore.
  • --auto β€” Rather than copying all specified files, only copy those that don't yet have the desired number of copies, or that are preferred content of the destination repository. It's the chill "only if you actually need it" option ✨
  • --fast β€” When copying content to a remote, avoid a round trip to check if the remote already has content. This can be faster, but might skip copying content to the remote in some cases. So like, speed over certainty β€” your call, bestie ⚑
  • --all -A β€” Rather than specifying a filename or path to copy, this option can be used to copy all available versions of all files. Yes, all of them. This is the default behavior when running git-annex in a bare repository.
  • --branch=ref β€” Operate on files in the specified branch or treeish 🌿
  • --unused β€” Operate on files found by the last run of git-annex unused. The leftovers finally get their moment.
  • --failed β€” Operate on files that have recently failed to be transferred. Retry arc πŸ˜­πŸ”
  • --key=keyname β€” Use this option to copy a specified key. Keys only, no filenames, we're being specific.
  • matching options β€” The git-annex-matching-options(1) can be used to specify what to copy. Mix and match, go feral πŸŽ€
  • --batch β€” Enables batch mode, in which lines containing names of files to copy are read from stdin.

As each specified file is processed, the usual progress output is displayed. If a file's content does not need to be copied, or it does not match specified matching options, or it is not an annexed file, a blank line is output in response instead.

Since the usual output while copying a file is verbose and not machine-parseable, you may want to use --json in combination with --batch. (Trust me on this one.)

  • --batch-keys β€” This is like --batch but the lines read from stdin are parsed as keys.
  • -z β€” Makes batch input be delimited by nulls instead of the usual newlines. Little null gremlin energy πŸ’€
  • --json β€” Enable JSON output. This is intended to be parsed by programs that use git-annex. Each line of output is a JSON object. Machine-readable and gorgeous.
  • --json-progress β€” Include progress objects in JSON output. Now your JSON also tells you how it's going πŸ“ˆ
  • --json-error-messages β€” Messages that would normally be output to standard error are included in the JSON instead. No more stderr jumpscares.

Also the git-annex-common-options(1) can be used. Free real estate 🎁


πŸ‘€ SEE ALSO


πŸ‘‘ AUTHOR

Joey Hess <id@joeyh.name>


And that's the whole page bestie, brought to you by the git-annex-copy(1) manual page from the General Commands Manual β€” go forth and copy responsibly πŸ’–πŸŒˆβ­

πŸ“¦ where this page comes from