How to remove untracked files in Git?

You can use git clean command to remove untracked files in local Git repository.

git clean -f

This command will permanently delete untracked files, therefore it is recommenced to take precautions.

You can see which files will be deleted with git clean using following command.

git clean -n

Learn more about the similar topics:
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.