1STG-REPAIR(1) StGit Manual STG-REPAIR(1)
2
3
4
6 stg-repair - Fix StGit metadata if branch was modified with git
7 commands
8
10 stg repair
11
13 If you modify an StGit stack (branch) with some git commands — such as
14 commit, pull, merge, and rebase — you will leave the StGit metadata in
15 an inconsistent state. In that situation, you have two options:
16
17 1. Use "stg undo" to undo the effect of the git commands. (If you know
18 what you are doing and want more control, "git reset" or similar
19 will work too.)
20
21 2. Use "stg repair". This will fix up the StGit metadata to
22 accommodate the modifications to the branch. Specifically, it will
23 do the following:
24
25 · If you have made regular git commits on top of your stack of
26 StGit patches, "stg repair" makes new StGit patches out of
27 them, preserving their contents.
28
29 · However, merge commits cannot become patches; if you have
30 committed a merge on top of your stack, "repair" will simply
31 mark all patches below the merge unapplied, since they are no
32 longer reachable. If this is not what you want, use "stg undo"
33 to get rid of the merge and run "stg repair" again.
34
35 · The applied patches are supposed to be precisely those that are
36 reachable from the branch head. If you have used e.g. "git
37 reset" to move the head, some applied patches may no longer be
38 reachable, and some unapplied patches may have become
39 reachable. "stg repair" will correct the appliedness of such
40 patches.
41
42 "stg repair" will fix these inconsistencies reliably, so as long
43 as you like what it does, you have no reason to avoid causing
44 them in the first place. For example, you might find it
45 convenient to make commits with a graphical tool and then have
46 "stg repair" make proper patches of the commits.
47
48 Note
49 If using git commands on the stack was a mistake, running "stg
50 repair" is not what you want. In that case, what you want is option
51 (1) above.
52
54 Part of the StGit suite - see stg(1)
55
56
57
58StGit 0.23 07/29/2020 STG-REPAIR(1)