how to remove untracked files in Git?

To remove untracked files / directories do:

git clean -fdx

-f – force

-d – directories too

-x – remove ignored files too ( don’t use this if you don’t want to remove ignored files)


Use with Caution!
These commands can permanently delete arbitrary files, that you havn’t thought of at first. Please double check and read all the comments below this answer and the –help section, etc., so to know all details to fine-tune your commands and surely get the expected result.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)