| Crates.io | repo-check |
| lib.rs | repo-check |
| version | 0.1.0 |
| created_at | 2026-01-09 03:40:20.628489+00 |
| updated_at | 2026-01-09 03:40:20.628489+00 |
| description | Check if local Git repositories are safe to delete |
| homepage | |
| repository | https://github.com/petamorikei/repo-check |
| max_upload_size | |
| id | 2031526 |
| size | 52,499 |
A CLI tool to check if local Git repositories are safe to delete.
repo-check scans Git repositories in a directory and determines whether each repository can be safely deleted without losing local-only work. It checks for:
cargo install repo-check
git clone https://github.com/yourname/repo-check.git
cd repo-check
cargo install --path .
# Scan repositories in current directory
repo-check
# Scan repositories in a specific directory
repo-check /path/to/workspace
/home/user/projects/my-app [SAFE]
- All checks passed
/home/user/projects/wip-feature [UNSAFE]
- Uncommitted changes exist
- Local-only commits exist
Dirty files: 3
Local-only commits: 2
/home/user/projects/local-only [UNKNOWN]
- No remote tracking refs found
---
Summary: 3 total, 1 SAFE, 1 UNSAFE, 1 UNKNOWN
| Status | Description |
|---|---|
| SAFE | No local-only changes detected. Safe to delete. |
| UNSAFE | Local-only changes exist. Do not delete. |
| UNKNOWN | Cannot determine (e.g., no remote configured). Deletion not recommended. |
# Show only SAFE repositories
repo-check --only-safe
# Show only UNSAFE repositories
repo-check --only-unsafe
# Show only UNKNOWN repositories
repo-check --only-unknown
# JSON output (for scripting)
repo-check --json
# Include current directory as a target
repo-check --include-dot
# Ignore untracked files when checking for uncommitted changes
repo-check --ignore-untracked
# Delete SAFE repositories (interactive confirmation)
repo-check --delete
# Delete without confirmation (for CI/scripts)
repo-check --delete --yes
# Move to trash instead of permanent deletion
repo-check --delete --trash
# Include UNKNOWN repositories in deletion candidates
repo-check --delete --allow-unknown
Detects modified, staged, or untracked files using git status --porcelain.
Detects stashed changes using git stash list.
Detects commits that exist in local branches but are not reachable from any remote tracking ref using git log --branches --not --remotes.
If no remote or remote tracking refs exist, the repository is marked as UNKNOWN since we cannot determine if commits are pushed.
git fetch. Remote tracking refs may be outdated..git is a directory.MIT
Contributions are welcome! Please open an issue or submit a pull request.