Links

Parsing `git status` for tracked & untracked changes

Posted on 15 Mar, 2021

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"