Commit d93542d4d4d3693f2d977d334f0dbe3150e9329b

Stefan Sperling 2020-08-08T12:09:35

In got-worktree(5), explain how to re-create a corrupt or missing file index.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/got/got-worktree.5 b/got/got-worktree.5
index 47e89f6..49ede63 100644
--- a/got/got-worktree.5
+++ b/got/got-worktree.5
@@ -124,8 +124,13 @@ Only present if a file addition or modification has been staged with
 .Cm got stage .
 .El
 .Pp
-A corrupt or missing file index can be recreated on demand with
-.Cm got update .
+A corrupt or missing file index can be recreated on demand as follows:
+.Pp
+.Dl $ mv .got/file-index .got/file-index.bad
+.Dl $ got update # re-create .got/file-index
+.Dl $ find\ . -type f -exec touch {}\ \\\ ; # update timestamp of all files
+.Dl $ got update # sync timestamps
+.Pp
 When the file index is modified, it is read into memory in its entirety,
 modified in place, and written to a temporary file.
 This temporary file is then moved on top of the old file index with