path: root/Documentation/git-checkout.txt
diff options
authorNguyễn Thái Ngọc Duy <>2013-04-12 23:12:08 (GMT)
committerJunio C Hamano <>2013-04-15 15:54:45 (GMT)
commit08d595dc1cdf6f0d8e6022a69c4fcdd2fba628cf (patch)
tree16b4f6d24e7a3419f6e247d9fd3498189d5c731d /Documentation/git-checkout.txt
parent85e7e81ccfcec98972e341ab81b0109084b84906 (diff)
checkout: add --ignore-skip-worktree-bits in sparse checkout mode
"git checkout -- <paths>" is usually used to restore all modified files in <paths>. In sparse checkout mode, this command is overloaded with another meaning: to add back all files in <paths> that are excluded by sparse patterns. As the former makes more sense for day-to-day use. Switch it to the default and the latter enabled with --ignore-skip-worktree-bits. While at there, add info/sparse-checkout to gitrepository-layout.txt Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-checkout.txt')
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 8edcdca..23a9413 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -180,6 +180,12 @@ branch by running "git rm -rf ." from the top level of the working tree.
Afterwards you will be ready to prepare your new files, repopulating the
working tree, by copying them from elsewhere, extracting a tarball, etc.
+ In sparse checkout mode, `git checkout -- <paths>` would
+ update only entries matched by <paths> and sparse patterns
+ in $GIT_DIR/info/sparse-checkout. This option ignores
+ the sparse patterns and adds back any files in <paths>.
When switching branches,