Skip to main content
The prune command manages revision-limit rules: per-pattern rules that keep only the latest N versions of matching files and prune older ones. For the concepts, branch-safe counting, and glob syntax, see the Revision Limits guide.
Pruning permanently deletes older file versions and cannot be undone. It runs automatically after every commit, with no prompt. Check a repo’s rules with dv prune list before you rely on them.
Requirements:
  • You must be an organization admin.
  • Revision limits are not supported on repositories synced with Git.
Rules are an ordered list. When more than one rule matches a path, the last matching rule wins. Adding a rule appends it to the end (highest priority). Each rule has a server-assigned id that list prints and that set / remove take.

list

Show every rule, in priority order.
Prints an ID, PATTERN, and KEEP column per rule. KEEP is a number, or all for a rule that keeps every version. With no rules, it prints No retention rules configured. list is the default subcommand — plain dv prune does the same thing.

add

Add a rule.
<pattern> is a repo-root-anchored glob (e.g. /Assets/....psd). Quote it so your shell does not expand the wildcards. See glob syntax. --keep is required:
  • <N> — keep the latest N versions (1 to 999).
  • all — keep every version (never prune). Use it to carve a path out of a broader limit.
The new rule is appended, so it takes priority over earlier matching rules. Example:

set

Edit a rule by id.
<id> is a rule id from dv prune list. Pass --keep, --pattern, or both — at least one is required. Example:

remove

Delete a rule by id.
Example:

Notes

  • Adding a rule applies it to future commits. It does not prune versions that already exceed the new limit; those are pruned as later commits touch each matching file.
  • Pruning runs in the background after each commit and is silent for the committer.
For the full conceptual guide and Perforce +S migration, see Revision Limits.