Listing untracked files in Git

List all the untracked files, including ignored files

git ls-files command is used to list files, add -o or --others to list all the untracked files:

# List all the untracked files, including the ignored files
$ git ls-files --others

List untracked files, excluding ignored files

--exclude-standard option excludes files in .gitignore, .git/info/exclude or the user’s global exclusion file.

# List untracked files, excluding the ignored files.
$ git ls-files --others --exclude-standard

Leave a Reply