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 delete command permanently removes one or more snapshots from storage.

Syntax

git-snapshot delete <name> [name2] [...]
Alias: rm
git-snapshot rm <name> [name2] [...]

Parameters

  • name: One or more snapshot names, hashes, or partial identifiers to delete

Examples

Delete a single snapshot

git-snapshot delete my-feature
Output:
This will delete 1 snapshot(s):
  my-feature.a1b2c3d4

Are you sure? [y/N] y
Deleted: my-feature.a1b2c3d4.snapshot

1 snapshot(s) deleted.

Delete multiple snapshots

git-snapshot delete my-feature experiment-1 old-work
Output:
This will delete 3 snapshot(s):
  my-feature.a1b2c3d4
  experiment-1.b5c6d7e8
  old-work.c9d0e1f2

Are you sure? [y/N] y
Deleted: my-feature.a1b2c3d4.snapshot
Deleted: experiment-1.b5c6d7e8.snapshot
Deleted: old-work.c9d0e1f2.snapshot

3 snapshot(s) deleted.

Delete by hash

git-snapshot delete a1b2c3d4

Delete using rm alias

git-snapshot rm my-feature

Abort deletion

git-snapshot delete my-feature
Output:
This will delete 1 snapshot(s):
  my-feature.a1b2c3d4

Are you sure? [y/N] n
Aborted.

Behavior

  • The command prompts for confirmation before deleting
  • Multiple snapshots can be deleted in a single command
  • If the same snapshot is matched multiple times, it’s only deleted once
  • The command only deletes snapshots from the current repository
  • Deletion is permanent and cannot be undone
Deleted snapshots cannot be recovered. Make sure you no longer need the snapshot before confirming deletion.

Repository filtering

The delete command only operates on snapshots from the current repository:
git-snapshot delete other-repo-snapshot
Output:
Error: The following snapshots were not found:
  other-repo-snapshot

Error handling

Snapshot not found

git-snapshot delete nonexistent
Output:
Error: The following snapshots were not found:
  nonexistent

Multiple snapshots not found

git-snapshot delete nonexistent another-missing
Output:
Error: The following snapshots were not found:
  nonexistent
  another-missing

Missing parameter

git-snapshot delete
Output:
Error: Please provide at least one snapshot name or hash
Usage: git-snapshot delete <name> [name2] ...

See also

  • prune - Delete all snapshots for the current repository

Build docs developers (and LLMs) love