git-annex-mirror(1)

πŸ“¦
version 10.20261026 Β· 3 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 noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ git-annex-mirror ✨

okay bestie, welcome to git-annex-mirror πŸ’– this is the mirror girlie from the General Commands Manual, and she is so underrated. sit down, hydrate, let's get into it 🫢


🌸 NAME 🌸

git-annex-mirror β€” mirror content of files to/from another repository


πŸ¦‹ SYNOPSIS πŸ¦‹


---

# πŸ‘‘ DESCRIPTION πŸ‘‘

so like. the whole vibe here is that this command makes a <mint>destination repository</mint> mirror a <mint>source repository</mint>. copy my fit exactly, no notes πŸ’…

Every single file you specify in the source repository gets mirrored over to the destination repository. If a file's content is <green>present</green> in the source repo, it gets copied to the destination. If a file's content is <red>not</red> present in the source repo? Then it will be <hotpink>dropped</hotpink> from the destination repository β€” but only when the `numcopies` setting allows it. like, she's not reckless, she checks first 😌

> ⚠️ lowkey important: `mirror` does **not** sync the git repository, bestie. it only does the **file contents**. that's it. if you wanted the git side too, use `git-annex-sync(1)` for that. different girl, different job πŸ”₯

---

# πŸ’… OPTIONS πŸ’…

- **`--to=remote`** β€” treats your local repository as the *source* repo and mirrors its contents out to the remote. you're the giver in this scenario πŸŽ€

- **`--from=remote`** β€” flips it! the remote becomes the *source* repo and its contents get mirrored into your local repository. receiving era 🫢

- **`--jobs=N`, `-JN`** β€” turns on parallel transfers, with up to the number of jobs you specify running at the same time. for example: `-J10` ✨

  Setting this to `"cpus"` will run one job per CPU core. it's giving "let the machine cook" πŸ”₯

- **`--all`, `-A`** β€” mirrors *all* objects stored in the git annex, not just the objects that currently existing files use. full sweep, main character energy πŸ‘‘

  > 🚨 however!! this <red>bypasses</red> checking the `.gitattributes` `annex.numcopies` setting when dropping files. so like, be aware, no cap.

  This is the default behavior when running git-annex in a <purple>bare repository</purple>.

- **`--branch=ref`** β€” operate on files in the specified branch or treeish 🌿

  > 🚨 same warning as `--all`: this <red>bypasses</red> checking the `.gitattributes` `annex.numcopies` setting when dropping files.

- **`--unused`** β€” operates on the files that were found by the last run of `git-annex unused`. it remembers the leftovers for you πŸ™ˆ

- **`--failed`** β€” operates on files that have recently failed to be transferred. retry era, we don't leave them behind 😭

- **matching options** β€” the `git-annex-matching-options(1)` can be used to control what exactly gets mirrored. very "choose your own adventure" of her 🧚

- **`--json`** β€” enables JSON output! this is intended to be parsed by programs that use git-annex. each line of output is a JSON object πŸ’»

  > πŸ‘€ note that unlike all other commands that support `--json`, this command outputs <hotpink>different types of json objects</hotpink> in different circumstances. she contains multitudes, fr fr.

- **`--json-progress`** β€” includes progress objects in the JSON output. so you can watch the little bar go πŸ“ˆ

- **`--json-error-messages`** β€” messages that would normally be output to standard error get included in the JSON instead. no lost error girlies πŸ’Œ

- Also the `git-annex-common-options(1)` can be used. go wild, bestie 🌈

---

# πŸ’œ SEE ALSO πŸ’œ

- `git-annex(1)`

- `git-annex-sync(1)`

---

# 🌟 AUTHOR 🌟

Joey Hess `<id@joeyh.name>` β€” icon, legend, the moment πŸŽ€

---

and that's the whole page, bestie!! this was `git-annex-mirror(1)` from the <purple>General Commands Manual</purple>, straight from the source. go mirror something slayfully πŸ’–βœ¨πŸ¦‹