listgits 
A simple script to list all Git repositories found in your home directory.
Overview 
This script searches for Git repositories by looking for .git directories in common locations under your home directory. It provides a quick way to see all the Git repositories you have on your system.
Usage 
bash
listgitsHow It Works 
The script searches for .git directories in:
- Direct subdirectories of your home directory (~/*/.git)
- Second-level subdirectories (~/*/*/.git)
For each .git directory found, it outputs the parent directory path (the actual repository directory).
Output Example 
text
/Users/username/project1
/Users/username/work/project2
/Users/username/personal/project3Use Cases 
- Repository inventory: Get a quick overview of all Git repositories on your system
- Cleanup: Identify repositories you might want to archive or delete
- Backup planning: Generate a list of repositories to include in backups
- Script input: Use the output as input for other scripts that operate on multiple repositories
Examples 
bash
# List all repositories
listgits
# Count total repositories
listgits | wc -l
# Find repositories in specific paths
listgits | grep work
# Use with other git tools (example)
for repo in $(listgits); do
  echo "Status of $repo:"
  # -C tells git to run in the specified directory
  git -C "$repo" status --porcelain
doneRequirements 
- Unix-like system with bash
- Git repositories in standard locations under home directory
Limitations 
- Only searches two levels deep under the home directory
- Only finds repositories with .gitdirectories (not bare repositories)
- Does not search outside the home directory
- May not find repositories in hidden directories (except .gititself)
Notes 
- The script uses shell globbing to find .gitdirectories
- Output includes full absolute paths to repository directories
- Empty lines in output indicate that some glob patterns didn't match any directories