git-annex-repair(1)

πŸ“¦
version 10.20261026 Β· 2 versions
  • 10.20261026 Β· alpine 3.24, arch rolling, debian bookworm, 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 (latest)
  • 8.20210223 Β· ubuntu jammy
, in alpine 3.24, arch rolling, debian bookworm, 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-repair(1) πŸ’–

okay bestie, welcome to the General Commands Manual entry for git-annex-repair β€” this one lives in the git-annex family and it's literally the glow-up your broken repo has been begging for ✨


🌸 NAME 🌸

git-annex-repair β€” recover broken git repository


πŸŽ€ SYNOPSIS πŸŽ€

git annex repair

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this command can repair many of the problems with git repositories that git fsck detects but does not itself fix. It's the one you call when a repository has become badly damaged 😭 One classic way that happens? A repository used by git-annex is sitting on a removable drive and someone yanks it out at exactly the wrong moment. rude, honestly.

and here's the fun part β€” this command can actually be used inside git repositories that don't use git-annex at all πŸ‘‘ When you use it in a repository that does use git-annex, it does additional repairs of the git-annex branch too. versatile queen.

the way it works: it deletes any corrupt objects from the git repository, and retrieves all missing objects it can from the remotes of the repository. slay.

if that's not sufficient to fully recover the repository, it can also:

  • reset branches back to commits before the corruption happened
  • delete branches that are no longer available due to the lost data
  • remove any missing files from the index
⚠️ but bestie, listen β€” it will only do those three things if you run it with the --force option, because that rewrites history and throws out missing data. that's a big deal, no cap. and note: the --force option never touches tags, even if they are no longer usable due to missing data. tags are safe, periodt. πŸ’…

after running this command, you will probably want to run git fsck to verify it fixed the repository. heads up though β€” fsck may still complain about objects referenced by the reflog, or the stash, if they were unable to be recovered. this command does not try to clean up either the reflog or the stash. not its job, not its problem πŸ™ˆ

it is also a good idea to run git annex fsck --fast after this command, to make sure that the git-annex branch reflects reality. vibe check your branch, fr fr.


✨ OPTIONS ✨

  • --force β€” enable repair actions that involve deleting data that has been lost due to git repository corruption πŸ”₯

also the git-annex-common-options(1) can be used. those are always invited to the party 🫢


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Joey Hess <id@joeyh.name>


and that's the whole page, babe β€” this is the git-annex-repair(1) manual page from the git-annex docs, and yes, it really does just say git-annex-repair(1) down there at the bottom too πŸŽ€ go fix your repo, you got this πŸ’œ