% git clean
fatal: clean.requireForce defaults to true
and neither -i, -n, nor -f given; refusing to clean
You will get this error when you try to clean your git local working directory if,
- You have set the clean.requireForce value as false in the .gitconfig local/global file, or,
- You have not set clean.requireForce in the .gitconfig local/global file.
- Set clean.requireForce as true in the config file.
- execute: git clean -n : to just tell which all files will be cleaned (dry run)
- execute: git clean -i : to get into interactive mode.
- execute: git clean -f: To force clean (overrides whats set in config file)
$ git clean -i
Would remove the following item:
d.txt
*** Commands ***
1: clean 2: filter by pattern 3: select by numbers
4: ask each 5: quit 6: help
What now> c
Removing d.txt
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!