You created new files in your project, and now want to see the list of these file. To see the list of files run the command:


git status --ignored --short

This command will list the files which does not belong to git using the status code !!. For example

touch MyProgram.java
git status --ignored --short
!! MyProgram.java

NOTE: For simplicity I’m listing only new files, which are not tracked by git. If there are other files which are version controlled and you added/modified/deleted them, they will also be shown by git  status command

The –ignore option however does not list the untracked files under the ignored directories. For example if you create a directory lib and added two jars (a.jar and b.jar) then the above command will give the following output

mkdir lib
cp <SOMEWHERE_ELSE>/a.jar  <SOMEWHERE_ELSE>/b.jar  lib/
git status --ignore --short
!! lib/

To see the list of untracked files under lib/ use –untracked-files=all option.

git status --ignore --short
!! lib/a.jar
!! lib/b.jar