-1

Context: I'm using a static checker to verify files in my working tree. I want to check all files in the current directory except those that would be ignored by git (object files for instance), including those that were not yet added to the repository. I also want to exclude files that are known to git but were deleted locally.

I think the best way to achieve that would be by using

find . -type f -exec <some git command that filters the input with git ignore>

...or by using git-ls with some option, or by using git show --porcelain

Penz
  • 5,428
  • 5
  • 31
  • 28
  • Oddly enough, the "Related" section on this page has [Show ignored files in git](http://stackoverflow.com/questions/466764/show-ignored-files-in-git?rq=1) which tells how you can get a list of ignored files. That should get you what you want. – Greg Burghardt Jul 21 '14 at 16:22
  • I need a list of files that *would not be ignored*, and not a list of ignored files. – Penz Jul 21 '14 at 17:58

1 Answers1

0

This does the trick:

git ls-tree -r --name-only HEAD
Penz
  • 5,428
  • 5
  • 31
  • 28