How to remove untracked files using git?
git cleanremoves all the untracked files from the project. It is very in large projects where you have lots of build related, log files which are not necessary to build the product. If you want to take the project to the clean state,
- Either you have to delete all those untracked files manually
- Clone the repository again.
git cleancomes in handy. For example, running the following command takes the project to the fresh cloned repository state.
git clean -f -x -d