How to remove untracked files from the current Git
Hey there, first you must know about git clean
If you want to have a look for what are the files will be deleted you can check with the -n option before you run the actual command:
git clean -n
Then it will delete the files for real! use the -f
git clean -f
Here I have added some more options. you just have a look and check it.
- It will remove directories, run
git clean -f -dorgit clean -fd - It will remove ignored files, run
git clean -f -Xorgit clean -fX - It will remove ignored and non-ignored files, run
git clean -f -xorgit clean -fx
