GIT-SPARSE-CHECKOUT(1) (NAME) git-sparse-checkout - (SYNOPSIS) git sparse-checkout (init | list | set | add | reapply | disable | check-rules | clean) [] (DESCRIPTION) (sparse checkouts) . . (cone mode ) (non-cone mode) . . / git commit -a / . . . (COMMANDS) list sparse-checkout. set ( core.sparseCheckout core.sparseCheckoutCone index.sparse) sparse-checkout set . (worktree) set . (sparsity) set sparse-checkout . git- worktree(1) extensions.worktreeConfig git-config(1) . --stdin . git ls-tree -d --name-only. ( (CONE PATTERN SET) ). --cone core.sparseCheckoutCone . --no-cone . --sparse-index. << >> . --[no-]sparse-index ( ). . git status git add . . . : . git sparse-checkout init --no-sparse-index . . add sparse-checkout ( ) ( ). --stdin . reapply . merge rebase ( ) sparse-checkout ( ). ( ) git sparse-checkout reapply . reapply --[no-]cone --[no-]sparse-index set . clean sparse-checkout. . sparse-checkout . (merge conflicts) sparse-checkout . git sparse-checkout reapply git sparse-checkout clean . index.sparse=true . clean -f --force clean.requireForce false . --dry-run . clean . --verbose . sparse-checkout . disable core.sparseCheckout . init set . . set init set . init ( ) set ( ) . . init sparse-checkout . set add . --cone --sparse-index disable init . check-rules . check-rules . git ls-tree --name-only ( --rules-file . git sparse-checkout set --stdin ( ). --rules-file . --rules-file --no-cone . -z \0 . --rules-file . (EXAMPLES) git sparse-checkout set MY/DIR1 SUB/DIR2 ( ) MY/DIR1/ SUB/DIR2/ ( MY/ SUB/ ). . . git sparse-checkout disable . git sparse-checkout add SOME/DIR/ECTORY SOME/DIR/ECTORY/ ( ) SOME/DIR/ SOME/. . git sparse-checkout reapply . ( /rebase) ( recursive ). . -- (INTERNALS -- SPARSE CHECKOUT) << >> (Sparse checkout) . skip-worktree ( git-update-index(1)) . skip-worktree . . $GIT_DIR/info/sparse-checkout skip-worktree . skip-worktree . . -- (INTERNALS -- NON-CONE PROBLEMS) $GIT_DIR/info/sparse-checkout set add ( ) .gitignore . ( ) gitignore . gitignore : o (pull merge rebase switch reset checkout ) O(N*M) N M . . o glob . o (globs) () sparse-checkout set/add . "git grep -- *.c" grep/log/status . sparse-checkout sparse-checkout rebase merge . o sparse-checkout add remove . remove << >> . o gitignore (include) ( ) .gitignore gitignore (exclude) ( ). gitignore <<>> . sparse-checkout . o << >> pathspec sparse-checkout gitignore . o <<>> . : : git sparse-checkout set '/toplevel-dir/*.c' : git sparse-checkout set relative-dir sparse-checkout current/subdirectory/toplevel-dir/*.c current/subdirectory/relative-dir set/add . gitignore . (bash-completion) set/add ! # * \ ? [ ] "/pro" "/proc" ( ) "/progress.txt" ( / .gitignore .) . o . --sparse-index . (partial clones) . . . -- (INTERNALS -- CONE MODE HANDLING) << >> (cone mode) . ( ) . Documentation/technical/ : o o Documentation/ o Documentation/technical/ . sparse-checkout sparse-checkout . .gitignore . . sparse-checkout git add git commit . << >> << -- >> . -- (INTERNALS -- FULL PATTERN SET) / . O(N*M) N M . core.sparseCheckoutCone . sparse-checkout .gitignore gitignore(5) . . ( gitignore ! ). unwanted ( unwanted ): git sparse-checkout set --no-cone '/*' '!unwanted' $GIT_DIR/info/sparse-checkout : /* !unwanted gitignore <> git-read-tree(1) . -- (INTERNALS -- CONE PATTERN SET) gitignore . : 1. (Recursive): . 2. (Parent): . git sparse-checkout set . sparse-checkout : /* !/*/ << .>> git sparse-checkout set . git sparse-checkout set A/B/C A/B/C A A/B . sparse-checkout : /* !/*/ /A/ !/A/*/ /A/B/ !/A/B/*/ /A/B/C/ . core.sparseCheckoutCone false sparse-checkout . . . core.sparseCheckoutCone false . $GIT_DIR/info/sparse-checkout git sparse-checkout list . sparse-checkout : $ git sparse-checkout list A/B/C core.ignoreCase=true . git sparse-checkout set . -- (INTERNALS -- SUBMODULES) (submodule) git submodule . git submodule init -- git submodule deinit [-f] -- ( push). sparse-checkout (deinitialized) . push . / . checkout ( ) sparse-checkout << >> deinit init . <<>> : sparse-checkout . git grep . (SEE ALSO) git-read-tree(1) gitignore(5) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-SPARSE-CHECKOUT(1)