From 08d595dc1cdf6f0d8e6022a69c4fcdd2fba628cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 13 Apr 2013 09:12:08 +1000 Subject: checkout: add --ignore-skip-worktree-bits in sparse checkout mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "git checkout -- " is usually used to restore all modified files in . In sparse checkout mode, this command is overloaded with another meaning: to add back all files in 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 --- Documentation/git-checkout.txt | 6 ++++++ Documentation/gitrepository-layout.txt | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 8edcdcae9d..23a9413525 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. +--ignore-skip-worktree-bits:: + In sparse checkout mode, `git checkout -- ` would + update only entries matched by and sparse patterns + in $GIT_DIR/info/sparse-checkout. This option ignores + the sparse patterns and adds back any files in . + -m:: --merge:: When switching branches, diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt index f0eef765b9..817337f575 100644 --- a/Documentation/gitrepository-layout.txt +++ b/Documentation/gitrepository-layout.txt @@ -184,6 +184,10 @@ info/exclude:: 'git clean' look at it but the core Git commands do not look at it. See also: linkgit:gitignore[5]. +info/sparse-checkout:: + This file stores sparse checkout patterns. + See also: linkgit:git-read-tree[1]. + remotes:: Stores shorthands for URL and default refnames for use when interacting with remote repositories via 'git fetch', -- cgit v1.2.3