A small CLI that recursively finds Git repositories under a directory and reports whether each repo is clean or dirty.
A repo is considered dirty if any of the following is true:
- No
originremote exists. - Current branch is not the repo's "main" branch (origin default, or
fallback to
main, thenmaster). - There are unpushed commits on the main branch.
- There are staged (but uncommitted) changes.
- There are unstaged or untracked changes.
Build from source:
go build ./cmd/gitscanScan current directory:
./gitscanScan a specific directory:
./gitscan /path/to/scanJSON output:
./gitscan --json /path/to/scanExclude directories by name (comma-separated):
./gitscan --exclude ".git,node_modules,vendor" /path/to/scan