Function: magit-sparse-checkout-set

magit-sparse-checkout-set is an autoloaded, interactive and byte-compiled function defined in magit-sparse-checkout.el.

Signature

(magit-sparse-checkout-set DIRECTORIES)

Documentation

Restrict working tree to DIRECTORIES.

To extend rather than override the currently configured directories, call magit-sparse-checkout-add instead.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-sparse-checkout.el
;;;###autoload
(defun magit-sparse-checkout-set (directories)
  "Restrict working tree to DIRECTORIES.
To extend rather than override the currently configured
directories, call `magit-sparse-checkout-add' instead."
  (interactive
    (list (magit-completing-read-multiple
           "Include these directories: "
           ;; Note: Given that the appeal of sparse checkouts is
           ;; dealing with very large trees, listing all subdirectories
           ;; may need to be reconsidered.
           (magit-revision-directories "HEAD"))))
  (magit-sparse-checkout--auto-enable)
  (magit-run-git-async "sparse-checkout" "set" directories))