Variable: projectile-command-history-scope

projectile-command-history-scope is a customizable variable defined in projectile.el.

Value

repository

Documentation

How widely a project's command history is shared.

- repository - every checkout of one repository shares a history. Two
  git worktrees, or two clones of the same upstream, are the same project
  on two branches: the commands you build and test it with are the same
  ones, so a worktree made this morning already knows them (issue #1786).

- project - each project root keeps its own history, so checkouts of one
  repository start empty and learn separately.

This is a single choice, not a list of aspects like the other options whose names end in -scope: one value replaces the other.

What gets shared is the history you browse - the list behind M-x previous-history-element (previous-history-element) at a command prompt. Two things stay this checkout's own, because both act without asking and a remembered command can carry absolute paths back into the checkout it was typed in: what a prompt is pre-filled with, and what projectile-repeat-last-command replays.

Sharing needs the repository to be identifiable (see projectile-repo-identity); a project Projectile can say nothing about keeps its own history whatever this is set to.

This variable was added, or its default value changed, in projectile version 3.4.0.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defcustom projectile-command-history-scope 'repository
  "How widely a project's command history is shared.

- `repository' - every checkout of one repository shares a history.  Two
  git worktrees, or two clones of the same upstream, are the same project
  on two branches: the commands you build and test it with are the same
  ones, so a worktree made this morning already knows them (issue #1786).

- `project' - each project root keeps its own history, so checkouts of one
  repository start empty and learn separately.

This is a single choice, not a list of aspects like the other options
whose names end in `-scope': one value replaces the other.

What gets shared is the history you browse - the list behind \\[previous-history-element]
at a command prompt.  Two things stay this checkout's own, because both
act without asking and a remembered command can carry absolute paths back
into the checkout it was typed in: what a prompt is pre-filled with, and
what `projectile-repeat-last-command' replays.

Sharing needs the repository to be identifiable (see
`projectile-repo-identity'); a project Projectile can say nothing about
keeps its own history whatever this is set to."
  :group 'projectile
  :type '(choice (const :tag "Share across checkouts of one repository" repository)
                 (const :tag "Keep a history per project root" project))
  :safe (lambda (value) (memq value '(repository project)))
  :package-version '(projectile . "3.4.0"))