Git clean is a convenient method for deleting untracked files in a repo's working directory. Untracked files are those that are in the repo's directory but have not yet been added to the repo's index with git add.
Common Git clean commands-
1. Use the following command to perform a dry run on cleaning the untracked files:
$ git clean -n
2. Use the following command to force clean the untracked files:
$ git clean -f
3. Use the following command to clean the untracked directories:
$ git clean -f -d