obliterate, which removes every version of a file, a revision limit keeps the file and its most recent versions — only the excess older versions are removed.
A “version” (also called a revision) is one committed state of a file.
--keep 3 means Diversion keeps the three most recent committed versions of each matching file and prunes anything older.Usage examples
Requirements
- You must be an organization admin.
- Revision limits are not supported on repositories synced with Git.
How it works
- An admin adds one or more rules. Each rule is a path pattern plus a keep count (see
dv prune). - After every commit, Diversion checks the files that commit touched against the rules and prunes versions beyond the keep count.
- Pruning runs in the background. It does not slow down the commit, and the person committing sees no prompt or warning.
dv prune list.
Keep counts
--keep <N>— keep the latestNversions (1to999).--keep 1keeps the head version only.--keep all— keep every version (never prune). Use this to carve a path back out of a broader limit (partially negate); see Rule order.
Branch-safe counting
“Keep N” is counted per branch, not per repository:- Every branch’s head version is always kept.
- A file’s stored bytes are deleted only when no kept version on any branch still needs them.
What is never pruned
- Drafts and shelves. Uncommitted work and shelved changes are always preserved.
- Every branch’s head. The latest version on each branch is always kept, even with
--keep 1.
Glob syntax
Patterns are anchored to the repo root. Always quote them so your shell does not expand the wildcards. This is the same pattern grammar asobliterate.
Rule order
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, so a later rule can override an earlier one. Use this to keep everything under a subtree while limiting a wider pattern:dv prune list prints rules in this priority order.
Managing rules
Usedv prune to list, add, edit, and remove rules:
Coming from Perforce
This is the Diversion equivalent of Perforce’s+S / +Sn file type modifier, which keeps only the last N revisions of a file.
When you import a Perforce depot, your existing +S rules can be brought over as Diversion revision limits so retention carries across the migration. The import produces a review report of the translated rules for an admin to apply. Contact the Diversion team to run a Perforce import.
Diversion guarantees branch-safe counting by design. Perforce’s
+S behavior across branches changed between server versions and is not consistent — Diversion always keeps every branch’s head and never deletes a version another branch still needs.Related
dv prune— CLI reference for managing rules- Obliterate — permanently delete every version of a file
- Storage — how Diversion stores and shares file versions
- Coming from Perforce — migration guide

