I know its an old question, but in terms of listing untracked files I thought I would add another one which also lists untracked folders:
You can used the git clean operation with -n (dry run) to show you which files it will remove (including the .gitignore files) by:
git clean -xdn
This has the advantage of showing all files and all folders that are not tracked. Parameters:
x
- Shows all untracked files (including ignored by git and others, like build output etc...)d
- show untracked directoriesn
- and most importantly! - dryrun, i.e. don't actually delete anything, just use the clean mechanism to display the results.It can be a little bit unsafe to do it like this incase you forget the -n
. So I usually alias it in git config.