How do you delete untracked local files from your current working tree?
Use git clean -f -d
to make sure that directories are also removed.
Don’t actually remove anything, just show what would be done.
git clean -n
or
git clean --dry-run
Remove untracked directories in addition to untracked files. If an untracked directory is managed by a different Git repository, it is not removed by default. Use the -f
option twice if you really want to remove such a directory.
git clean -fd
You can then check if your files are really gone with git status
.