I've learned I can use count
to find the NUMBER of commits a branch is ahead/behind by, like so:
git rev-list --count HEAD..@{u}
But is there a way to do so for uncommitted files?
Just found out git status -suno
shows how many files have been changed in a really concise way, so I could either count the lines of the output (with echo "$var" | wc -l
) or just put a symbol to denote an arbitrary amount exist, or parse it in a weird way to see the number of deleted/added/modified.
However, do non "porcelain" and more directly-addressing commands exist to accomplish this task, as parsing commands such as these are seen as bad practice?
Also, I am using this to add to a git-bash prompt; I would normally just type in git status, but would like to have maximum convenience by just showing such.