Skip to main content

Show only dirty repositories

Use the --dirty or -d flag to show only repositories with uncommitted changes:
dirty -d ~/code
This filters out all clean repositories, showing only those with:
  • Modified files
  • Staged changes
  • Untracked files

Example output

$ dirty -d ~/code
 * apps/dashboard
 * libs/ui-kit [local]
 * services/auth
 * tools/scripts [local]

4 repos, 4 dirty, 2 local-only
Use dirty -d before leaving work to quickly see which repositories have uncommitted changes that might need attention.

Show only local-only repositories

Use the --local or -l flag to show only repositories without remote configurations:
dirty -l ~/code
This is useful for finding:
  • Experimental projects not yet pushed to a remote
  • Repositories that need remote setup
  • Local-only work that might need backing up

Example output

$ dirty -l ~/code
 * libs/ui-kit [local]
   tools/cli [local]
 * tools/scripts [local]

3 repos, 2 dirty, 3 local-only
Local-only repositories have no backup on a remote server. Consider adding a remote or backing them up regularly.

Combining filters

You can combine both filters to find repositories that are both dirty and local-only:
dirty -dl ~/code
Or using the long form:
dirty --dirty --local ~/code

Example output

$ dirty -dl ~/code
 * libs/ui-kit [local]
 * tools/scripts [local]

2 repos, 2 dirty, 2 local-only
When filters are combined, only repositories matching ALL criteria are shown.

Use cases

Before shutting down

# Check for uncommitted work
dirty -d ~/projects

Finding repositories to backup

# Find local-only repos that need remotes
dirty -l ~/code

Critical uncommitted work

# Find work that's both uncommitted AND not backed up
dirty -dl ~/projects
The summary line at the bottom always shows the total count across all found repositories, even when filters are applied.

Build docs developers (and LLMs) love