I\'m trying to figure out how to easily count the files in my uncommitted index.
I\'ve tried:
git status | grep \'#\' | wc -l
but there
If you want something a script can use:
git diff --cached --numstat | wc -l
If you want something human readable:
git diff --cached --stat
Below should cover for all cases (new, modified, deleted and even untracked), it returns a number.
(git status -s |select-string -Pattern "^\s*[A|\?|D|M]" -AllMatches).Matches.Count