@@ -136,6 +136,43 @@ paths to pass to a subsequent 'set' or 'add' command. However,
136
136
the disable command, so the easy restore of calling a plain `init`
137
137
decreased in utility.
138
138
139
+ EXAMPLES
140
+ --------
141
+ `git sparse-checkout set MY/DIR1 SUB/DIR2`::
142
+
143
+ Change to a sparse checkout with all files (at any depth) under
144
+ MY/DIR1/ and SUB/DIR2/ present in the working copy (plus all
145
+ files immediately under MY/ and SUB/ and the toplevel
146
+ directory). If already in a sparse checkout, change which files
147
+ are present in the working copy to this new selection. Note
148
+ that this command will also delete all ignored files in any
149
+ directory that no longer has either tracked or
150
+ non-ignored-untracked files present.
151
+
152
+ `git sparse-checkout disable`::
153
+
154
+ Repopulate the working directory with all files, disabling sparse
155
+ checkouts.
156
+
157
+ `git sparse-checkout add SOME/DIR/ECTORY`::
158
+
159
+ Add all files under SOME/DIR/ECTORY/ (at any depth) to the
160
+ sparse checkout, as well as all files immediately under
161
+ SOME/DIR/ and immediately under SOME/. Must already be in a
162
+ sparse checkout before using this command.
163
+
164
+ `git sparse-checkout reapply`::
165
+
166
+ It is possible for commands to update the working tree in a
167
+ way that does not respect the selected sparsity directories.
168
+ This can come from tools external to Git writing files, or
169
+ even affect Git commands because of either special cases (such
170
+ as hitting conflicts when merging/rebasing), or because some
171
+ commands didn't fully support sparse checkouts (e.g. the old
172
+ `recursive` merge backend had only limited support). This
173
+ command reapplies the existing sparse directory specifications
174
+ to make the working directory match.
175
+
139
176
INTERNALS -- SPARSE CHECKOUT
140
177
----------------------------
141
178
@@ -154,12 +191,6 @@ directory, it updates the skip-worktree bits in the index based
154
191
on this file. The files matching the patterns in the file will
155
192
appear in the working directory, and the rest will not.
156
193
157
- To enable the sparse-checkout feature, run `git sparse-checkout set` to
158
- set the patterns you want to use.
159
-
160
- To repopulate the working directory with all files, use the
161
- `git sparse-checkout disable` command.
162
-
163
194
164
195
INTERNALS -- CONE PATTERN SET
165
196
-----------------------------
0 commit comments