git-annex-repair(1)
π 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--forceoption, because that rewrites history and throws out missing data. that's a big deal, no cap. and note: the--forceoption 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 π
π¦ where this page comes from
- alpine 3.24: git-annex-doc 10.20261026-r0 Β· AGPL-3.0-or-later
- arch rolling: git-annex 10.20261026-2 Β· AGPL-3.0-only
- debian bookworm: git-annex 10.20230126-3 Β· AGPL-3.0-or-later
- debian trixie: git-annex 10.20250416-2 Β· AGPL-3.0-or-later
- debian trixie: git-annex 10.20250416-2+deb13u1 Β· AGPL-3.0-or-later
- epel 10: git-annex 10.20250320-1.el10_0 Β· AGPL-3.0-or-later
- fedora 43: git-annex 10.20250630-4.fc43 Β· AGPL-3.0-or-later
- fedora 43: git-annex 10.20250929-5.fc43 Β· AGPL-3.0-or-later
- fedora 44: git-annex 10.20260115-1.fc44 Β· AGPL-3.0-or-later
- nixos 26.05: git-annex 10.20260421
- nixpkgs unstable: git-annex 10.20260421
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- opensuse-leap 16.0: git-annex 10.20250828-bp160.1.1 Β· AGPL-3.0-or-later AND GPL-3.0-or-later AND BSD-2-Clause AND MIT AND GPL-2.0-only
- ubuntu noble: git-annex 10.20240129-1build1 Β· AGPL-3.0-or-later
- ubuntu questing: git-annex 10.20250721-1
- ubuntu resolute: git-annex 10.20251029-1ubuntu1 Β· AGPL-3.0-or-later
- ubuntu stonking: git-annex 10.20251029-1ubuntu1 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms