Function: projectile-invalidate-cache-all

projectile-invalidate-cache-all is an autoloaded, interactive and byte-compiled function defined in projectile.el.

Signature

(projectile-invalidate-cache-all)

Documentation

Invalidate the caches of every known project.

Runs the same per-project invalidation as projectile-invalidate-cache over all projects in projectile-known-projects(var)/projectile-known-projects(fun) (plus any project that only has an entry in projectile-projects-cache), and also clears the global project root and file-existence caches. When persistent caching is enabled the projects' on-disk cache files are deleted too.

Remote (TRAMP) projects are skipped, as touching each one could mean a slow connection round-trip per project; invalidate those individually with projectile-invalidate-cache.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
;;;###autoload
(defun projectile-invalidate-cache-all ()
  "Invalidate the caches of every known project.

Runs the same per-project invalidation as `projectile-invalidate-cache'
over all projects in `projectile-known-projects' (plus any project that
only has an entry in `projectile-projects-cache'), and also clears the
global project root and file-existence caches.  When persistent caching
is enabled the projects' on-disk cache files are deleted too.

Remote (TRAMP) projects are skipped, as touching each one could mean a
slow connection round-trip per project; invalidate those individually
with `projectile-invalidate-cache'."
  (interactive)
  (setq projectile-project-root-cache (make-hash-table :test 'equal))
  (clrhash projectile-file-exists-cache)
  (let ((roots (seq-remove #'file-remote-p
                           (delete-dups
                            (append (projectile-known-projects)
                                    (hash-table-keys projectile-projects-cache))))))
    (dolist (project-root roots)
      (projectile--invalidate-project-cache project-root))
    (projectile--message "Invalidated the caches of %d project(s)" (length roots)))
  (when (fboundp 'recentf-cleanup)
    (recentf-cleanup)))