git-annex-reinject(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-reinject πŸ’–

okay bestie, welcome to the git-annex-reinject(1) page from the General Commands Manual β€” yes it's a real one, yes it's a banger, let's get into it πŸŽ€


✨ NAME ✨

git-annex-reinject β€” inject content of file back into annex πŸ¦‹


🌸 SYNOPSIS 🌸

git annex reinject [src dest]

git annex reinject --known [src]

πŸ’… DESCRIPTION πŸ’…

So basically: this command moves the content of the src file (or files!) into the annex. That's the whole vibe. But here's the catch β€” only known file contents will be reinjected. Any src files that are unknown? Left completely unchanged. Not touched. Not even a little. πŸ™ˆ

When is this iconic? When you've obtained the content of a file from somewhere else and you want it in your local annex, fr fr. Like, say a file's content got lost 😭 and you have a backup β€” you restore that backup and reinject it into your local repository. Slay, data restored. πŸ’–

There are two ways to use this, and you gotta pick one:

  1. Specifying a src file and the name of a dest file (the dest lives inside the repository's working tree) β€” this injects the src file as the content of the dest file.
git annex reinject /tmp/foo.iso foo.iso
  1. The --known option β€” this reinjects all known src files, and you don't even need to specify a dest file. Main character energy, no dest required. πŸ‘‘
git annex reinject --known /tmp/*.iso

⭐ OPTIONS ⭐

  • --known β€” with this option, each specified src file gets hashed using the default key-value backend (or the one you specify with --backend), and if git-annex has a record of the resulting key having been in the annex before, then the content gets reinjected. 🫢
heads up bestie, if you're using a key-value backend that includes the filename extension in the key, this will only work if the src files have the same extensions as the files with the same content that was originally added to git-annex. extension mismatch = no reinject, sorry πŸ’€
also note: this will reinject old versions of files that have been modified or deleted from the current git branch. use git-annex-unused(1) to detect when such old and potentially unused files have been reinjected. lowkey important, don't skip this one. πŸ‘€
  • --backend β€” specify the key-value backend to use when checking if a file is known with the --known option. 🌈
  • --guesskeys β€” with this option, each specified source file is checked to see if it has the name of a git-annex key, and if so it is imported as the content of that key. it's giving detective energy πŸ”

this can be used to pluck git-annex objects out of lost+found, as long as the original filename has not been lost, and it's particularly useful when using key-value backends that don't hash to the content of a file. ✨

when the key-value backend does support hashing, the content of the file is verified before importing it. safety first, always. πŸŽ€

  • --json β€” Enable JSON output. This is intended to be parsed by programs that use git-annex. Each line of output is a JSON object. πŸ€–
  • --json-error-messages β€” Messages that would normally be output to standard error are included in the JSON instead. errors but make it JSON, periodt. πŸ’…
  • Also the git-annex-common-options(1) can be used. don't forget the classics bestie πŸ’œ

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

Joey Hess <id@joeyh.name>


okay that's the whole page, you ate that. this was the git-annex-reinject(1) page from the General Commands Manual, and yeah β€” the footer is literally just the same name again, git-annex-reinject(1), iconic of it honestly. go reinject something, bestie πŸŒΈπŸ’–βœ¨