I need a script to process all the staged, modified and untracked files (with honor to ignore).
Since git ls-files --cached
lists all the files, either changed or not, in its output, I have to merge the outputs from 2 different commands to get the full list:
# Untracked.
git ls-files --others --exclude-standard
# Modified and cached.
git diff HEAD --name-only
Or include modified in git ls-files
# Modified and untracked
git ls-files --others --modified --exclude-standard
# Cached
git diff --cached --name-only
Can I get the full list with git ls-files
only?