Git detect if there are raw files fast

Is there a way to quickly determine if there are any raw files?

I can list all unused files with

git ls-files --other --directory --exclude-standard 

But this is a slow process if there are many unused files. Is there something like git diff -q where the exit status determines if any files exist without a trace?

+4
source share
2 answers

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

+15
source

git status will notify you of any files without a trace.

Output Example:

 remco@Prosperpine ~/code/Sick-Beard (master) $ git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # init.osx nothing added to commit but untracked files present (use "git add" to track) 
+1
source

All Articles