I’d like Git to show me a list of “new files” in a certain directory, where by “new files” I mean files that are either untracked or which have been added to the index. In other words, I want a command that will do the equivalent of
git status -s some_directory | grep '^\(??\|A \)'
Is there a “git-only” way to do this, or should I just stick with using grep
? I’ve tried
git ls-files -o some_directory
which works great for showing the untracked files, but I couldn’t find a flag that would also show files that have been added.