If you have what you want, when you see the first file without a trace, close it.
If you use GNU / anything
git ls-files --other --directory --exclude-standard | sed q1
install rc1, if any
Otherwise
anyuntracked() { return `git ls-files -o --directory --exclude-standard | sed q | wc -l` } anyuntracked
will do the same job
source share