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
RootPath- Root directory to search for git repositories
Output
Shows the status of each git repository found, including:
- Clean (no changes)
- Modified files
- Ahead/behind remote
- Untracked files
- Branch information
Examples
Check All Repositories in a Directory
nmbl gitstatus ~/projectsShows 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 ~/workspaceEnsure all repositories are in a known state.
Use Cases
Team Workspace Management
nmbl gitstatus ~/company-projectsCheck the status of all company repositories in one command.
Monorepo Monitoring
nmbl gitstatus ~/monorepoMonitor 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
fiRepository 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:
- Clean - No uncommitted changes, up to date with remote
- Modified - Has uncommitted changes
- Ahead - Local commits not pushed to remote
- Behind - Remote commits not pulled locally
- Diverged - Both local and remote have unique commits
- Untracked - Files not in version control
Tips
Combine with Git Update
# First check status
nmbl gitstatus ~/projects
# Then update all repositories
nmbl gitupdate ~/projectsCreate 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"Related Commands
gitupdate- Pull latest changes in multiple repositories