Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mubshrx/git-snapshot/llms.txt

Use this file to discover all available pages before exploring further.

The prune command permanently removes all snapshots associated with the current repository.

Syntax

git-snapshot prune

Examples

Prune all snapshots

git-snapshot prune
Output:
This will delete ALL 5 snapshot(s) for this repository:

  my-feature.a1b2c3d4
  experiment-1.b5c6d7e8
  old-work.c9d0e1f2
  refactor.d3e4f5a6
  e7f8a9b0

Are you sure you want to delete ALL snapshots? [y/N] y
Deleted: my-feature.a1b2c3d4.snapshot
Deleted: experiment-1.b5c6d7e8.snapshot
Deleted: old-work.c9d0e1f2.snapshot
Deleted: refactor.d3e4f5a6.snapshot
Deleted: e7f8a9b0.snapshot

All snapshots pruned.

Abort pruning

git-snapshot prune
Output:
This will delete ALL 3 snapshot(s) for this repository:

  my-feature.a1b2c3d4
  experiment-1.b5c6d7e8
  old-work.c9d0e1f2

Are you sure you want to delete ALL snapshots? [y/N] n
Aborted.

No snapshots to prune

git-snapshot prune
Output:
No snapshots to prune for this repository.

Behavior

  • Only deletes snapshots belonging to the current repository
  • Prompts for confirmation before deletion, emphasizing that ALL snapshots will be removed
  • Lists all snapshots that will be deleted before confirmation
  • Deletion is permanent and cannot be undone
  • Snapshots from other repositories are not affected
The prune command deletes ALL snapshots for the current repository. This action is permanent and cannot be undone. Make sure you no longer need any of the snapshots before confirming.

Repository matching

Snapshots are matched to repositories by:
  1. Comparing the remote URL (if both the snapshot and current repo have one)
  2. Falling back to comparing the repository path
This ensures that only snapshots truly belonging to the current repository are deleted.

Use cases

Clean up after completing work

When you’ve finished a project and committed all important changes:
git-snapshot prune

Free up storage space

If you have many old snapshots you no longer need:
git-snapshot list
git-snapshot prune

Reset before starting fresh

Before starting new work where you’ll create new snapshots:
git-snapshot prune

See also

  • delete - Delete specific snapshots instead of all snapshots
  • list - View all snapshots before pruning