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