You have to either set requireForce
to false
in your .gitconfig
or use the -f
or -i
flag with this command.
git clean -f
will force to clean the untracked files even ifclean.requireForce
is set to true which is default.git clean -i
will give you an interactive way for cleaning each filegit clean -n
will just show which files will be removed if you perform git clean.
Reference: https://git-scm.com/docs/git-clean