git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Victoria Dye <vdye@github.com>,
	Lessley Dennington <lessleydennington@gmail.com>,
	Derrick Stolee <derrickstolee@github.com>,
	Elijah Newren <newren@gmail.com>,
	Elijah Newren <newren@gmail.com>,
	Elijah Newren <newren@gmail.com>
Subject: [PATCH v3 6/9] git-sparse-checkout.txt: add a new EXAMPLES section
Date: Fri, 22 Apr 2022 02:32:23 +0000	[thread overview]
Message-ID: <7908c8f83d85c5e0bfea8476f0d9577d41ccd82b.1650594746.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1148.v3.git.1650594746.gitgitgadget@gmail.com>

From: Elijah Newren <newren@gmail.com>

Since many users like to learn from examples, provide a section in the
manual with example commands that would be used and a brief explanation
of what each does.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 Documentation/git-sparse-checkout.txt | 43 +++++++++++++++++++++++----
 1 file changed, 37 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index 2083e6df356..c54437428bb 100644
--- a/Documentation/git-sparse-checkout.txt
+++ b/Documentation/git-sparse-checkout.txt
@@ -136,6 +136,43 @@ paths to pass to a subsequent 'set' or 'add' command.  However,
 the disable command, so the easy restore of calling a plain `init`
 decreased in utility.
 
+EXAMPLES
+--------
+`git sparse-checkout set MY/DIR1 SUB/DIR2`::
+
+	Change to a sparse checkout with all files (at any depth) under
+	MY/DIR1/ and SUB/DIR2/ present in the working copy (plus all
+	files immediately under MY/ and SUB/ and the toplevel
+	directory).  If already in a sparse checkout, change which files
+	are present in the working copy to this new selection.  Note
+	that this command will also delete all ignored files in any
+	directory that no longer has either tracked or
+	non-ignored-untracked files present.
+
+`git sparse-checkout disable`::
+
+	Repopulate the working directory with all files, disabling sparse
+	checkouts.
+
+`git sparse-checkout add SOME/DIR/ECTORY`::
+
+	Add all files under SOME/DIR/ECTORY/ (at any depth) to the
+	sparse checkout, as well as all files immediately under
+	SOME/DIR/ and immediately under SOME/.  Must already be in a
+	sparse checkout before using this command.
+
+`git sparse-checkout reapply`::
+
+	It is possible for commands to update the working tree in a
+	way that does not respect the selected sparsity directories.
+	This can come from tools external to Git writing files, or
+	even affect Git commands because of either special cases (such
+	as hitting conflicts when merging/rebasing), or because some
+	commands didn't fully support sparse checkouts (e.g. the old
+	`recursive` merge backend had only limited support).  This
+	command reapplies the existing sparse directory specifications
+	to make the working directory match.
+
 INTERNALS -- SPARSE CHECKOUT
 ----------------------------
 
@@ -154,12 +191,6 @@ 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 set` to
-set the patterns you want to use.
-
-To repopulate the working directory with all files, use the
-`git sparse-checkout disable` command.
-
 
 INTERNALS -- CONE PATTERN SET
 -----------------------------
-- 
gitgitgadget


  parent reply	other threads:[~2022-04-22  2:33 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  7:39 [PATCH 0/9] sparse-checkout: make cone mode the default Elijah Newren via GitGitGadget
2022-03-08  7:39 ` [PATCH 1/9] tests: stop assuming --no-cone is the default mode for sparse-checkout Elijah Newren via GitGitGadget
2022-03-08  7:39 ` [PATCH 2/9] sparse-checkout: make --cone the default Elijah Newren via GitGitGadget
2022-03-08 14:26   ` Derrick Stolee
2022-03-12  2:01     ` Elijah Newren
2022-03-08  7:39 ` [PATCH 3/9] git-sparse-checkout.txt: wording updates for the cone mode default Elijah Newren via GitGitGadget
2022-03-08  7:39 ` [PATCH 4/9] git-sparse-checkout.txt: update docs for deprecation of 'init' Elijah Newren via GitGitGadget
2022-03-08  7:39 ` [PATCH 5/9] git-sparse-checkout.txt: shuffle some sections and mark as internal Elijah Newren via GitGitGadget
2022-03-08  7:39 ` [PATCH 6/9] git-sparse-checkout.txt: add a new EXAMPLES section Elijah Newren via GitGitGadget
2022-03-08 14:30   ` Derrick Stolee
2022-03-12  1:58     ` Elijah Newren
2022-03-08  7:39 ` [PATCH 7/9] git-sparse-checkout.txt: flesh out non-cone mode pattern discussion a bit Elijah Newren via GitGitGadget
2022-03-08  7:39 ` [PATCH 8/9] git-sparse-checkout.txt: mark non-cone mode as deprecated Elijah Newren via GitGitGadget
2022-03-08  7:39 ` [PATCH 9/9] Documentation: some sparsity wording clarifications Elijah Newren via GitGitGadget
2022-03-08 14:34 ` [PATCH 0/9] sparse-checkout: make cone mode the default Derrick Stolee
2022-03-12  3:11 ` [PATCH v2 " Elijah Newren via GitGitGadget
2022-03-12  3:11   ` [PATCH v2 1/9] tests: stop assuming --no-cone is the default mode for sparse-checkout Elijah Newren via GitGitGadget
2022-03-14 20:18     ` Junio C Hamano
2022-03-15 17:15       ` Derrick Stolee
2022-03-12  3:11   ` [PATCH v2 2/9] sparse-checkout: make --cone the default Elijah Newren via GitGitGadget
2022-03-14 20:34     ` Junio C Hamano
2022-04-22  2:29       ` Elijah Newren
2022-03-12  3:11   ` [PATCH v2 3/9] git-sparse-checkout.txt: wording updates for the cone mode default Elijah Newren via GitGitGadget
2022-03-14 20:39     ` Junio C Hamano
2022-03-12  3:11   ` [PATCH v2 4/9] git-sparse-checkout.txt: update docs for deprecation of 'init' Elijah Newren via GitGitGadget
2022-03-14 20:53     ` Junio C Hamano
2022-04-22  2:29       ` Elijah Newren
2022-04-22  6:09         ` Junio C Hamano
2022-03-12  3:11   ` [PATCH v2 5/9] git-sparse-checkout.txt: shuffle some sections and mark as internal Elijah Newren via GitGitGadget
2022-03-14 20:55     ` Junio C Hamano
2022-04-22  2:30       ` Elijah Newren
2022-03-12  3:11   ` [PATCH v2 6/9] git-sparse-checkout.txt: add a new EXAMPLES section Elijah Newren via GitGitGadget
2022-03-12  3:11   ` [PATCH v2 7/9] git-sparse-checkout.txt: flesh out non-cone mode pattern discussion a bit Elijah Newren via GitGitGadget
2022-03-14 20:57     ` Junio C Hamano
2022-04-22  2:30       ` Elijah Newren
2022-03-12  3:11   ` [PATCH v2 8/9] git-sparse-checkout.txt: mark non-cone mode as deprecated Elijah Newren via GitGitGadget
2022-03-14 21:13     ` Junio C Hamano
2022-04-22  2:31       ` Elijah Newren
2022-03-12  3:11   ` [PATCH v2 9/9] Documentation: some sparsity wording clarifications Elijah Newren via GitGitGadget
2022-03-14 15:25   ` [PATCH v2 0/9] sparse-checkout: make cone mode the default Derrick Stolee
2022-03-14 19:04   ` Victoria Dye
2022-03-14 20:12   ` Junio C Hamano
2022-03-14 23:19     ` Junio C Hamano
2022-04-22  2:32   ` [PATCH v3 " Elijah Newren via GitGitGadget
2022-04-22  2:32     ` [PATCH v3 1/9] tests: stop assuming --no-cone is the default mode for sparse-checkout Elijah Newren via GitGitGadget
2022-04-22  2:32     ` [PATCH v3 2/9] sparse-checkout: make --cone the default Elijah Newren via GitGitGadget
2022-04-22  2:32     ` [PATCH v3 3/9] git-sparse-checkout.txt: wording updates for the cone mode default Elijah Newren via GitGitGadget
2022-04-22  2:32     ` [PATCH v3 4/9] git-sparse-checkout.txt: update docs for deprecation of 'init' Elijah Newren via GitGitGadget
2022-04-22  2:32     ` [PATCH v3 5/9] git-sparse-checkout.txt: shuffle some sections and mark as internal Elijah Newren via GitGitGadget
2022-04-22  2:32     ` Elijah Newren via GitGitGadget [this message]
2022-04-22  2:32     ` [PATCH v3 7/9] git-sparse-checkout.txt: flesh out pattern set sections a bit Elijah Newren via GitGitGadget
2022-04-22  2:32     ` [PATCH v3 8/9] git-sparse-checkout.txt: mark non-cone mode as deprecated Elijah Newren via GitGitGadget
2022-04-22  2:32     ` [PATCH v3 9/9] Documentation: some sparsity wording clarifications Elijah Newren via GitGitGadget
2022-04-25 14:38     ` [PATCH v3 0/9] sparse-checkout: make cone mode the default Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7908c8f83d85c5e0bfea8476f0d9577d41ccd82b.1650594746.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=lessleydennington@gmail.com \
    --cc=newren@gmail.com \
    --cc=vdye@github.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).