git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
6f540a3443c7b255f7db80b2bb3544f0266b6ad8 blob 3139 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
 
git-sparse-checkout(1)
=======================

NAME
----
git-sparse-checkout - Initialize and modify the sparse-checkout
configuration, which reduces the checkout to a set of directories
given by a list of prefixes.


SYNOPSIS
--------
[verse]
'git sparse-checkout <subcommand> [options]'


DESCRIPTION
-----------

Initialize and modify the sparse-checkout configuration, which reduces
the checkout to a set of directories given by a list of prefixes.


COMMANDS
--------
'list'::
	Provide a list of the contents in the sparse-checkout file.

'init'::
	Enable the `core.sparseCheckout` setting. If the
	sparse-checkout file does not exist, then populate it with
	patterns that match every file in the root directory and
	no other directories, then will remove all directories tracked
	by Git. Add patterns to the sparse-checkout file to
	repopulate the working directory.

'add'::
	Add a set of patterns to the sparse-checkout file, as given over
	stdin. Updates the working directory to match the new patterns.

SPARSE CHECKOUT
----------------

"Sparse checkout" allows populating the working directory sparsely.
It uses the skip-worktree bit (see linkgit:git-update-index[1]) to tell
Git whether a file in the working directory is worth looking at. If
the skip-worktree bit is set, then the file is ignored in the working
directory. Git will not populate the contents of those files, which
makes a sparse checkout helpful when working in a repository with many
files, but only a few are important to the current user.

The `$GIT_DIR/info/sparse-checkout` file is used to define the
skip-worktree reference bitmap. When Git updates the working
directory, it resets the skip-worktree bit in the index based on this
file. If an entry
matches a pattern in this file, skip-worktree will not be set on
that entry. Otherwise, skip-worktree will be set.

Then it compares the new skip-worktree value with the previous one. If
skip-worktree turns from set to unset, it will add the corresponding
file back. If it turns from unset to set, that file will be removed.

## FULL PATTERN SET

By default, the sparse-checkout file uses the same syntax as `.gitignore`
files.

While `$GIT_DIR/info/sparse-checkout` is usually used to specify what
files are in, you can also specify what files are _not_ in, using
negate 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
read-tree' and similar commands is disabled by default. You need to
set `core.sparseCheckout` to `true` in order to have sparse checkout
support.

SEE ALSO
--------

linkgit:git-read-tree[1]
linkgit:gitignore[5]

GIT
---
Part of the linkgit:git[1] suite
debug log:

solving 6f540a3443 ...
found 6f540a3443 in https://public-inbox.org/git/0f095e85d5bf29346bdc5bf1707bb51eaf2202ae.1566313865.git.gitgitgadget@gmail.com/
found 50c53ee60a in https://public-inbox.org/git/e6e982e5a6e4517d97a7a404384057110f3a151d.1566313865.git.gitgitgadget@gmail.com/
found ca0ca6a12f in https://public-inbox.org/git/c37b5f2c29d42e7c0c727596625d4eb50b6ddb4f.1566313865.git.gitgitgadget@gmail.com/

applying [1/3] https://public-inbox.org/git/c37b5f2c29d42e7c0c727596625d4eb50b6ddb4f.1566313865.git.gitgitgadget@gmail.com/
diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
new file mode 100644
index 0000000000..ca0ca6a12f


applying [2/3] https://public-inbox.org/git/e6e982e5a6e4517d97a7a404384057110f3a151d.1566313865.git.gitgitgadget@gmail.com/
diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index ca0ca6a12f..50c53ee60a 100644


applying [3/3] https://public-inbox.org/git/0f095e85d5bf29346bdc5bf1707bb51eaf2202ae.1566313865.git.gitgitgadget@gmail.com/
diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt
index 50c53ee60a..6f540a3443 100644

Checking patch Documentation/git-sparse-checkout.txt...
Applied patch Documentation/git-sparse-checkout.txt cleanly.
Checking patch Documentation/git-sparse-checkout.txt...
Applied patch Documentation/git-sparse-checkout.txt cleanly.
Checking patch Documentation/git-sparse-checkout.txt...
Applied patch Documentation/git-sparse-checkout.txt cleanly.

index at:
100644 6f540a3443c7b255f7db80b2bb3544f0266b6ad8	Documentation/git-sparse-checkout.txt

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git