divekit history remove
Remove every historical version of files from all repositories
Synopsis
Remove every historical blob version of one or more complete files from the repositories of a distribution, also where the path is already absent from the current tree.
WHAT HAPPENS:
- Mirrors every selected repository and records branches, tags, the blob versions at the paths and the other paths that reuse those blobs
- Shows the plan and asks for the destructive confirmation
- Makes affected projects private, archives them and schedules GitLab’s server-side rewrite
- Verifies the result from a fresh mirror, runs housekeeping, waits GitLab’s 30 minute grace interval, prunes and verifies that the blobs are gone
- Unarchives projects that were not archived before
–dry-run stops after the inventory and changes nothing. The run is resumable: an interruption prints the run ID and the exact resume command.
Usage
divekit history remove [flags]
Examples
# Show what removing the leaked file would change, without changing anything
divekit history remove -d ST2M4 --path data/members.csv --dry-run
# Run it for all repositories, then resume if it was interrupted
divekit history remove -d ST2M4 --path data/members.csv
divekit history resume 20261021-1a2b3c -d ST2M4
Flags
-d, --distribution string Distribution name
-n, --dry-run Make the inventory and show the complete plan without changing GitLab
--exclude-blocked Continue without the repositories that fail preflight (forks, missing Owner role, unreadable repositories). They stay untouched and exposed
--path stringArray File to remove from the whole history, as a path from the repository root (repeatable). Directories and patterns are not accepted
-r, --remote string Remote repository URL (e.g. GitLab instance)
--target stringArray Narrow the scope to this target, for example work or eval (repeatable). The default is every recorded target
-t, --token string GitLab token or token file path (file:///...)
--uuid stringArray Narrow the scope to the repository with this UUID (repeatable). The default is every recorded repository
Inherited Flags
-l, --loglevel string log level (debug, info, warn, error, fatal) (default "info")
--no-index skip project index update
--non-interactive run in non-interactive mode (fails if interactive input is required)
-y, --yes assume yes/default for all prompts (non-interactive with automatic defaults)