Is there a way to quickly detect if there are any untracked files?
I can list all of the untracked files with
git ls-files --other --directory --exclude-standard
But this is slow if there are many untracked files. Is there something like git diff -q where the exit status determines whether or not any untracked files exist?
If you have what you want when you’ve seen the first untracked file, quit right then.
If you’re on GNU/anything
will set rc1 if there are any
Otherwise,
will do the same job