Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: clean.requireForce defaults to true and neither -i, -n, nor -f given; refusing to clean

When I am trying to clean all untracked files by git clean it shows me the error:

fatal: clean.requireForce defaults to true and neither -i, -n, nor -f given; refusing to clean 

How to resolve it?

like image 699
Sazzad Hissain Khan Avatar asked Dec 31 '15 06:12

Sazzad Hissain Khan


1 Answers

You have to either set requireForce to false in your .gitconfig or use the -f or -i flag with this command.

  1. git clean -f will force to clean the untracked files even if clean.requireForce is set to true which is default.
  2. git clean -i will give you an interactive way for cleaning each file
  3. git clean -n will just show which files will be removed if you perform git clean.

Reference: https://git-scm.com/docs/git-clean

like image 60
Sazzad Hissain Khan Avatar answered Sep 23 '22 14:09

Sazzad Hissain Khan