aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-sparse-checkout.txt
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-11-21 22:04:38 +0000
committerJunio C Hamano <gitster@pobox.com>2019-11-22 16:11:44 +0900
commit72918c1ad91504f56c395cc91c5072651125662a (patch)
tree2b758a07f18725cfd47349a7e09d011b4f788dd1 /Documentation/git-sparse-checkout.txt
parent7bffca95ea1ca4f55663374ea9b929b9df5be04b (diff)
downloadgit-72918c1ad91504f56c395cc91c5072651125662a.tar.gz
sparse-checkout: create 'disable' subcommand
The instructions for disabling a sparse-checkout to a full working directory are complicated and non-intuitive. Add a subcommand, 'git sparse-checkout disable', to perform those steps for the user. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-sparse-checkout.txt')
-rw-r--r--Documentation/git-sparse-checkout.txt27
1 files changed, 12 insertions, 15 deletions
diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index a724eae09c..c2cb19f80d 100644
--- a/Documentation/git-sparse-checkout.txt
+++ b/Documentation/git-sparse-checkout.txt
@@ -51,6 +51,10 @@ To avoid interfering with other worktrees, it first enables the
When the `--stdin` option is provided, the patterns are read from
standard in as a newline-delimited list instead of from the arguments.
+'disable'::
+ Remove the sparse-checkout file, set `core.sparseCheckout` to
+ `false`, and restore the working directory to include all files.
+
SPARSE CHECKOUT
---------------
@@ -68,6 +72,14 @@ directory, it updates the skip-worktree bits in the index based
on this file. The files matching the patterns in the file will
appear in the working directory, and the rest will not.
+To enable the sparse-checkout feature, run `git sparse-checkout init` to
+initialize a simple sparse-checkout file and enable the `core.sparseCheckout`
+config setting. Then, run `git sparse-checkout set` to modify the patterns in
+the sparse-checkout file.
+
+To repopulate the working directory with all files, use the
+`git sparse-checkout disable` command.
+
## FULL PATTERN SET
By default, the sparse-checkout file uses the same syntax as `.gitignore`
@@ -82,21 +94,6 @@ using negative patterns. For example, to remove the file `unwanted`:
!unwanted
----------------
-Another tricky thing is fully repopulating the working directory when you
-no longer want sparse checkout. You cannot just disable "sparse
-checkout" because skip-worktree bits are still in the index and your working
-directory is still sparsely populated. You should re-populate the working
-directory with the `$GIT_DIR/info/sparse-checkout` file content as
-follows:
-
-----------------
-/*
-----------------
-
-Then you can disable sparse checkout. Sparse checkout support in 'git
-checkout' and similar commands is disabled by default. You need to
-set `core.sparseCheckout` to `true` in order to have sparse checkout
-support.
SEE ALSO
--------