Removing local untracked files
We can remove local untracked files from the current working tree by using the
git clean command. The command will identify files without version control recursively from the current directory.
To first check which files and directories will be deleted:
git clean -n -d
To then proceed to delete those files and directories:
git clean -f -d
If you do not want to remove untracked directories remove the
-d switch from the above two commands.
To finally check that the untracked files have indeed been deleted:
This should show you that there are no more untracked files.