Parsing git status for tracked & untracked changes
January 18, 2025 · View on GitHub
Get count of untracked changes ➕️ (new files)
git status --porcelain | grep -c "??\s"
Get count of tracked "deleted" files
git status --porcelain | grep -c "AD\s"
Get count of modified files
git status --porcelain | grep -c "M\s"
Get count of tacked changes
git status --porcelain | grep -c "A\s"