{"id":29821025,"url":"https://github.com/cod-e-codes/ignoregrets","last_synced_at":"2026-05-01T12:32:59.484Z","repository":{"id":306610793,"uuid":"1026732120","full_name":"Cod-e-Codes/ignoregrets","owner":"Cod-e-Codes","description":"Snapshots of your Git-ignored files. Because resets shouldn’t mean regrets.","archived":false,"fork":false,"pushed_at":"2025-07-28T02:39:07.000Z","size":74,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-10T06:08:23.307Z","etag":null,"topics":["backups","cli","code-maintenance","developer-tools","dotfiles","git","git-tools","gitignore","go","snapshot","tooling"],"latest_commit_sha":null,"homepage":"https://github.com/Cod-e-Codes/ignoregrets","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cod-e-Codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-26T13:51:41.000Z","updated_at":"2025-08-10T02:00:13.000Z","dependencies_parsed_at":"2025-07-26T20:03:19.046Z","dependency_job_id":"d57de119-a220-4078-85cb-16343fe4e9a5","html_url":"https://github.com/Cod-e-Codes/ignoregrets","commit_stats":null,"previous_names":["cod-e-codes/ignoregrets"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Cod-e-Codes/ignoregrets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Fignoregrets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Fignoregrets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Fignoregrets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Fignoregrets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cod-e-Codes","download_url":"https://codeload.github.com/Cod-e-Codes/ignoregrets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Fignoregrets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32497812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backups","cli","code-maintenance","developer-tools","dotfiles","git","git-tools","gitignore","go","snapshot","tooling"],"created_at":"2025-07-28T23:39:01.685Z","updated_at":"2026-05-01T12:32:59.448Z","avatar_url":"https://github.com/Cod-e-Codes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ignoregrets\r\n\r\n**Snapshots of your Git-ignored files. Because resets shouldn't mean regrets.**\r\n\r\n[![Go Report Card](https://goreportcard.com/badge/github.com/Cod-e-Codes/ignoregrets)](https://goreportcard.com/report/github.com/Cod-e-Codes/ignoregrets)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\r\n\r\n`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.\r\n\r\n## Features\r\n\r\n- Snapshot Git-ignored files (from `.gitignore` and `.git/info/exclude`) tied to commit hashes.\r\n- Store snapshots locally as `.tar.gz` archives in `.ignoregrets/snapshots/`.\r\n- Restore files safely with `--dry-run` previews and `--force` overwrite protection.\r\n- Compare current files to snapshots with detailed status reporting.\r\n- Manage snapshot retention with pruning to prevent storage bloat.\r\n- Automate snapshots and restores with optional `pre-commit` and `post-checkout` Git hooks.\r\n- Configure via `.ignoregrets/config.yaml` with CLI flag overrides.\r\n- Cross-platform support (Linux, macOS, Windows) with minimal dependencies.\r\n\r\n## Installation\r\n\r\n### From Binary (Recommended)\r\n\r\nDownload the latest release from [GitHub Releases](https://github.com/Cod-e-Codes/ignoregrets/releases):\r\n\r\n#### Latest Release (v0.1.2)\r\n- Windows: `ignoregrets_v0.1.2_windows_amd64.exe`\r\n- Linux: `ignoregrets_v0.1.2_linux_amd64`\r\n- macOS: `ignoregrets_v0.1.2_darwin_amd64`\r\n\r\n#### Previous Releases\r\n- v0.1.1-pre (superseded)\r\n- v0.1.0\r\n\r\n### From Source\r\n\r\n```bash\r\ngo install github.com/Cod-e-Codes/ignoregrets@latest\r\n```\r\nRequires Go 1.24.4 or later.\r\n\r\n## Strategic Positioning\r\n\r\n`ignoregrets` is a focused tool for snapshotting and restoring Git-ignored files with commit awareness. Uses portable archives and checksums. Local-first, Git-state-agnostic, and integrates cleanly into existing workflows.\r\n\r\n- **What it is**: Narrow-scope tool for Git-ignored file management with commit awareness\r\n- **What it isn't**: Not a secret manager, backup solution, or configuration management system\r\n- **Integration**: Designed for CI/CD, automation, and development workflows\r\n\r\n→ **[Advanced Usage and Strategic Positioning](docs/ADVANCED_USAGE_AND_POSITIONING.md)**\r\n\r\n## Quick Start\r\n\r\n1. Initialize in a Git repository:\r\n   ```bash\r\n   ignoregrets init --hooks\r\n   ```\r\n   Creates `.ignoregrets/config.yaml` and installs Git hooks (if specified).\r\n\r\n2. Snapshot ignored files:\r\n   ```bash\r\n   ignoregrets snapshot\r\n   ```\r\n\r\n3. Check file drift:\r\n   ```bash\r\n   ignoregrets status\r\n   ```\r\n\r\n4. Restore files:\r\n   ```bash\r\n   ignoregrets restore --dry-run  # Preview\r\n   ignoregrets restore --force    # Restore\r\n   ```\r\n\r\n### Next Steps\r\n\r\n- **Advanced workflows**: See [Advanced Usage and Strategic Positioning](docs/ADVANCED_USAGE_AND_POSITIONING.md)\r\n- **CI/CD integration**: Examples for GitHub Actions, deployment scripts, and automation\r\n- **Performance optimization**: Large repository patterns and best practices\r\n\r\n## Commands\r\n\r\n### `init [--hooks]`\r\nInitialize the repository by creating `.ignoregrets/config.yaml`. Optionally installs `pre-commit` and `post-checkout` Git hooks.\r\n- **Flags**: `--hooks` (install Git hooks)\r\n- **Example**:\r\n  ```bash\r\n  ignoregrets init --hooks\r\n  ```\r\n  Output:\r\n  ```\r\n  Initialized ignoregrets successfully\r\n  Config file: .ignoregrets/config.yaml\r\n  Git hooks installed successfully\r\n  ```\r\n\r\n### `snapshot`\r\nCreate a snapshot of Git-ignored files for the current commit, stored as `\u003ccommit\u003e_\u003ctimestamp\u003e_\u003cindex\u003e.tar.gz`. Files are filtered based on `config.yaml` exclude/include patterns.\r\n- **Example**:\r\n  ```bash\r\n  ignoregrets snapshot\r\n  ```\r\n\r\n### `restore [--commit \u003csha\u003e] [--snapshot \u003cindex\u003e] [--force] [--dry-run]`\r\nRestore files from the latest snapshot for the current commit (or specified commit/index).\r\n- **Flags**:\r\n  - `--commit`: Restore from specific commit hash\r\n  - `--snapshot`: Specific snapshot index (default: latest)\r\n  - `--force`: Overwrite existing files\r\n  - `--dry-run`: Preview restore actions\r\n- **Example**:\r\n  ```bash\r\n  ignoregrets restore --commit abc123 --dry-run\r\n  ```\r\n  Output:\r\n  ```\r\n  Would restore:\r\n  - build/output\r\n  - .env\r\n  No files will be restored (dry-run mode).\r\n  ```\r\n\r\n### `status [--verbose]`\r\nCompare current Git-ignored files to the latest snapshot for the current commit.\r\n- **Flags**:\r\n  - `--verbose`: Show detailed per-file differences including checksums\r\n- **Example**:\r\n  ```bash\r\n  ignoregrets status --verbose\r\n  ```\r\n  Output:\r\n  ```\r\n  Snapshot for commit abc123:\r\n  - Unchanged: build/output\r\n  - Modified: .env\r\n    Old checksum: abc123...\r\n    New checksum: def456...\r\n  - Added: newfile.txt\r\n  - Deleted: oldfile.log\r\n  ```\r\n\r\n### `prune [--retention \u003cN\u003e]`\r\nDelete older snapshots, keeping the latest N per commit (default: config `retention`).\r\n- **Flags**:\r\n  - `--retention`: Number of snapshots to keep per commit\r\n- **Example**:\r\n  ```bash\r\n  ignoregrets prune --retention 5\r\n  ```\r\n  Output:\r\n  ```\r\n  Pruning snapshots for commit abc123:\r\n    Deleting abc123_20250726T0233_1.tar.gz\r\n  ```\r\n\r\n### `list`\r\nList all snapshots with commit hash, timestamp, index, and file count.\r\n- **Example**:\r\n  ```bash\r\n  ignoregrets list\r\n  ```\r\n  Output:\r\n  ```\r\n  Available snapshots:\r\n  --------------------\r\n  Commit: abc123\r\n    [0] 2025-07-26 02:33:00 (2 files)\r\n  ```\r\n\r\n### `inspect [--commit \u003csha\u003e] [--snapshot \u003cindex\u003e] [--verbose]`\r\nShow details of a snapshot (default: latest for current commit).\r\n- **Flags**:\r\n  - `--commit`: Commit hash of snapshot\r\n  - `--snapshot`: Snapshot index\r\n  - `--verbose`: Show file checksums\r\n- **Example**:\r\n  ```bash\r\n  ignoregrets inspect --commit abc123 --verbose\r\n  ```\r\n  Output:\r\n  ```\r\n  Snapshot details:\r\n  ----------------\r\n  Commit:    abc123\r\n  Timestamp: 2025-07-26 02:33:00\r\n  Index:     0\r\n\r\n  Configuration:\r\n    Retention:     10\r\n    Snapshot on:   [commit]\r\n    Restore on:    [checkout]\r\n    Hooks enabled: false\r\n    Exclude:       [*.log]\r\n    Include:       [.env]\r\n\r\n  Files (2 total):\r\n    build/output\r\n      SHA256: abc123...\r\n    .env\r\n      SHA256: def456...\r\n  ```\r\n\r\n## Configuration\r\n\r\nConfiguration is stored in `.ignoregrets/config.yaml`:\r\n```yaml\r\nretention: 10              # Snapshots to keep per commit\r\nsnapshot_on: [commit]      # Git events for auto-snapshot\r\nrestore_on: [checkout]     # Git events for auto-restore\r\nhooks_enabled: false       # Enable Git hooks\r\nexclude: [\"*.log\"]         # Glob patterns to exclude\r\ninclude: [\".env\"]         # Additional files to include\r\n```\r\n\r\nOverride retention with CLI flags:\r\n```bash\r\nignoregrets prune --retention 5\r\nignoregrets restore --force --commit abc123 --snapshot 0\r\n```\r\n\r\n## Git Hooks\r\n\r\nWhen enabled (`hooks_enabled: true` or `ignoregrets init --hooks`):\r\n- `pre-commit`: Creates snapshots before committing\r\n- `post-checkout`: Suggests restores after branch switches\r\n\r\nEnable hooks via:\r\n- `ignoregrets init --hooks`\r\n- Set `hooks_enabled: true` in config\r\n\r\n## Example Workflow\r\n\r\n1. Build your project, creating artifacts:\r\n   ```bash\r\n   npm run build\r\n   ```\r\n\r\n2. Snapshot the build output:\r\n   ```bash\r\n   ignoregrets snapshot\r\n   ```\r\n\r\n3. Switch branches (hook suggests restore):\r\n   ```bash\r\n   git checkout feature-branch\r\n   # Hook: \"Run 'ignoregrets restore --force' to restore files\"\r\n   ```\r\n\r\n4. Check what would be restored:\r\n   ```bash\r\n   ignoregrets restore --dry-run\r\n   ```\r\n\r\n5. Restore files if needed:\r\n   ```bash\r\n   ignoregrets restore --force\r\n   ```\r\n\r\n## Troubleshooting\r\n\r\n- **\"not a Git repository\"**: Run from Git repo root\r\n- **\"no snapshots found\"**: Create snapshot first\r\n- **\"file exists\"**: Use `--force` to overwrite\r\n- **\"no files to snapshot\"**: No ignored files found\r\n- **\"manifest.json not found\"**: Snapshot corrupted\r\n\r\nFor Windows users: Git hooks are installed with appropriate permissions, but you may need to run with administrator privileges for certain operations.\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Write idiomatic Go code with tests in the appropriate `internal/*/test.go` files\r\n4. Run tests: `go test ./...`\r\n5. Submit a pull request\r\n\r\nCode style: Follow Go conventions, use single-responsibility functions, and include comments for clarity.\r\n\r\n## License\r\n\r\nMIT License - see [LICENSE](LICENSE) file for details. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcod-e-codes%2Fignoregrets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcod-e-codes%2Fignoregrets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcod-e-codes%2Fignoregrets/lists"}