I would like to list all files that are not ignored by .gitignore, ie all source files of my repository.
ag
does it well by default, but I\'m not aware of
git status --short| grep '^?' | cut -d\ -f2-
will give you untracked files.
If you union it with git ls-files
, you've got all unignored files:
( git status --short| grep '^?' | cut -d\ -f2- && git ls-files ) | sort -u
you can then filter by
( xargs -d '\n' -- stat -c%n 2>/dev/null ||: )
to get only the files that are stat-able (== on disk).