Function: projectile-discard-root-cache

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

Signature

(projectile-discard-root-cache)

Documentation

Clear projectile-project-root-cache without touching other caches.

Useful after creating, removing, or moving a project marker (e.g.
.projectile or .git) - Projectile would otherwise keep returning
its previously cached answer for that directory.

See also projectile-invalidate-cache, which does this and also drops the per-project file list and project-type caches.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
;;;###autoload
(defun projectile-discard-root-cache ()
  "Clear `projectile-project-root-cache' without touching other caches.
Useful after creating, removing, or moving a project marker (e.g.
`.projectile' or `.git') - Projectile would otherwise keep returning
its previously cached answer for that directory.

See also `projectile-invalidate-cache', which does this and also drops
the per-project file list and project-type caches."
  (interactive)
  (setq projectile-project-root-cache (make-hash-table :test 'equal))
  ;; The file-existence cache holds the negative answers gathered
  ;; while walking up looking for project markers; without clearing it
  ;; here, a freshly-created `.projectile' over TRAMP wouldn't be
  ;; visible until the entries time out (see
  ;; `projectile-file-exists-remote-cache-expire').
  (clrhash projectile-file-exists-cache)
  (projectile--message "Cleared the project root cache"))