1git-annex-repair(1) General Commands Manual git-annex-repair(1)
2
3
4
6 git-annex-repair - recover broken git repository
7
9 git annex repair
10
12 This can repair many of the problems with git repositories that git
13 fsck detects, but does not itself fix. It's useful if a repository has
14 become badly damaged. One way this can happen is if a repository used
15 by git-annex is on a removable drive that gets unplugged at the wrong
16 time.
17
18 This command can actually be used inside git repositories that do not
19 use git-annex at all; when used in a repository using git-annex, it
20 does additional repairs of the git-annex branch.
21
22 It works by deleting any corrupt objects from the git repository, and
23 retrieving all missing objects it can from the remotes of the reposiā
24 tory.
25
26 If that is not sufficient to fully recover the repository, it can also
27 reset branches back to commits before the corruption happened, delete
28 branches that are no longer available due to the lost data, and remove
29 any missing files from the index. It will only do this if run with the
30 --force option, since that rewrites history and throws out missing
31 data. Note that the --force option never touches tags, even if they
32 are no longer usable due to missing data.
33
34 After running this command, you will probably want to run git fsck to
35 verify it fixed the repository. Note that fsck may still complain about
36 objects referenced by the reflog, or the stash, if they were unable to
37 be recovered. This command does not try to clean up either the reflog
38 or the stash.
39
40 It is also a good idea to run git annex fsck --fast after this command,
41 to make sure that the git-annex branch reflects reality.
42
44 --force
45
46 Enable repair actions that involve deleting data that has been
47 lost due to git repository corruption.
48
50 git-annex(1)
51
52 git-annex-fsck(1)
53
55 Joey Hess <id@joeyh.name>
56
57 git-annex-repair(1)