gitstatus - Git Repository Status

Overview

The gitstatus command checks the status of all git repositories within a directory tree. It reports whether each repository is clean, has uncommitted changes, is ahead/behind the remote, or has other status conditions. This is particularly useful when working with multiple related repositories.

Syntax

nmbl gitstatus <RootPath>

Arguments

Output

Shows the status of each git repository found, including:

Examples

Check All Repositories in a Directory

nmbl gitstatus ~/projects

Shows status of all git repositories under the projects directory.

Check Current Directory

nmbl gitstatus .

Checks the current directory and all subdirectories for git repositories.

Find Repositories with Uncommitted Changes

nmbl gitstatus ~/projects | grep -i "modified"

Find repositories that have uncommitted changes (Unix/Linux).

Pre-Commit Check

# Before a team sync, check all repos
nmbl gitstatus ~/workspace

Ensure all repositories are in a known state.

Use Cases

Team Workspace Management

nmbl gitstatus ~/company-projects

Check the status of all company repositories in one command.

Monorepo Monitoring

nmbl gitstatus ~/monorepo

Monitor all sub-repositories within a monorepo structure.

End of Day Checklist

# Before leaving for the day, ensure everything is committed
nmbl gitstatus ~/workspace | grep -v "clean"

Find any repositories with uncommitted work.

CI/CD Validation

# In a CI build script
nmbl gitstatus /build/checkout

# Fail build if unexpected changes
if nmbl gitstatus /build/checkout | grep -q "modified"; then
  echo "Error: Unexpected changes detected"
  exit 1
fi

Repository Discovery

# Find all git repositories in a large directory tree
nmbl gitstatus ~/code | grep "Repository:"

Discover all git repositories you’re working with.

Understanding Status Output

Common status indicators:

Tips

Combine with Git Update

# First check status
nmbl gitstatus ~/projects

# Then update all repositories
nmbl gitupdate ~/projects

Create a Daily Report

# Add to your shell profile
alias dailystatus='nmbl gitstatus ~/projects > ~/daily-git-status.txt && cat ~/daily-git-status.txt'

Filter Specific Branches

# Find repos not on main branch
nmbl gitstatus ~/projects | grep -v "main"