Skip to main content

Scanning a directory

To scan a directory for git repositories, use the dirty command followed by a path:
dirty ~/code
This will recursively search for git repositories and display their status.

Understanding the output

Here’s an example of what the output looks like:
$ dirty ~/code
 * apps/dashboard
   apps/storefront
 * libs/ui-kit [local]
   libs/common
 * services/auth
   services/payments
   tools/cli [local]
 * tools/scripts [local]

8 repos, 4 dirty, 3 local-only

Status indicators

Each repository is displayed with status indicators:
  • * — Repository has uncommitted changes (displayed in red)
  • [local] — Repository has no remotes configured (displayed in yellow)
Repositories without these markers are clean and have at least one remote configured.
The asterisk (*) appears for any uncommitted or untracked changes, including modified files, staged changes, or new untracked files.

Search depth

By default, dirty searches up to 3 levels deep from the specified directory:
# Uses default depth of 3
dirty ~/projects

# Search only immediate subdirectories
dirty -L 1 ~/projects

# Search deeper (5 levels)
dirty -L 5 ~/projects
The search stops when it finds a .git folder. Nested repositories inside another repository are not scanned.

Summary line

At the bottom of the output, you’ll see a summary line:
8 repos, 4 dirty, 3 local-only
This shows:
  • Total repositories found (8 repos)
  • Repositories with uncommitted changes (4 dirty)
  • Repositories without remotes (3 local-only)
Use the -L flag to adjust the search depth if you have a deeply nested project structure or want to scan only immediate subdirectories.

Build docs developers (and LLMs) love