You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Snapshots of your Git-ignored files. Because resets shouldn't mean regrets.**
4
4
5
-
`ignoregrets` is a lightweight, local-only CLI tool for snapshotting and restoring Git-ignored files (e.g., build artifacts, .env files, IDE metadata) tied to Git commits. It helps preserve ephemeral or environment-specific files that would otherwise be lost during branch switches or resets.
5
+
`ignoregrets` is a lightweight, local-only CLI tool designed for solo developers to snapshot and restore Git-ignored files (e.g., build artifacts, `.env` files, IDE metadata) tied to Git commits. It prevents the loss of ephemeral or environment-specific files during branch switches or resets. Snapshots are stored as `.tar.gz` archives in `.ignoregrets/snapshots/` with a `manifest.json` for metadata and SHA256 checksums, ensuring integrity and safety.
6
6
7
7
## Features
8
8
9
-
- Create snapshots of Git-ignored files, linked to commit hashes
10
-
- Store snapshots locally as `.tar.gz` archives with SHA256 checksums
11
-
- Restore files safely with dry-run and force options
12
-
- Track file changes with detailed status reporting
13
-
- Manage snapshots with retention policies
14
-
- Optional Git hooks for automatic snapshots and restores
15
-
- Config-first approach with CLI flag overrides
9
+
- Snapshot Git-ignored files (from `.gitignore` and `.git/info/exclude`) tied to commit hashes.
10
+
- Store snapshots locally as `.tar.gz` archives in `.ignoregrets/snapshots/`.
11
+
- Restore files safely with `--dry-run` previews and `--force` overwrite protection.
12
+
- Compare current files to snapshots with detailed status reporting.
13
+
- Manage snapshot retention with pruning to prevent storage bloat.
14
+
- Automate snapshots and restores with optional `pre-commit` and `post-checkout` Git hooks.
15
+
- Configure via `.ignoregrets/config.yaml` with CLI flag overrides.
16
+
- Cross-platform support (Linux, macOS, Windows) with minimal dependencies.
16
17
17
18
## Installation
18
19
19
20
```bash
20
21
go install github.com/Cod-e-Codes/ignoregrets@latest
21
22
```
23
+
Requires Go 1.24.4 or later.
22
24
23
25
## Quick Start
24
26
25
-
1. Initialize in your Git repository:
27
+
1. Initialize in a Git repository:
26
28
```bash
27
29
ignoregrets init --hooks
28
30
```
31
+
Creates `.ignoregrets/config.yaml` and installs Git hooks (if specified).
-`snapshot`: Create a snapshot of Git-ignored files
49
-
-`restore`: Restore files from a snapshot
50
-
-`status`: Compare current files with latest snapshot
51
-
-`prune`: Clean up old snapshots
52
-
-`list`: List all available snapshots
53
-
-`inspect`: Show details of a specific snapshot
54
-
-`init`: Initialize repository and set up hooks
51
+
### `init [--hooks]`
52
+
Initialize the repository by creating `.ignoregrets/config.yaml`. Optionally installs `pre-commit` and `post-checkout` Git hooks.
53
+
-**Flags**: `--hooks` (install Git hooks)
54
+
-**Example**:
55
+
```bash
56
+
ignoregrets init --hooks
57
+
```
58
+
Output:
59
+
```
60
+
Initialized ignoregrets successfully
61
+
Config file: .ignoregrets/config.yaml
62
+
Git hooks installed successfully
63
+
```
64
+
65
+
### `snapshot`
66
+
Create a snapshot of Git-ignored files for the current commit, stored as `<commit>_<timestamp>_<index>.tar.gz`. Files are filtered based on `config.yaml` exclude/include patterns.
0 commit comments