
% 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
More Posts related to Git,
- Fix [oh-my-zsh] Cant update: not a git repository
- [fix] fatal: pathspec index.html did not match any files error
- How to ignore files in git using .gitignore file
- Git Fix: fatal: refusing to merge unrelated histories Error
- Install GitHub Command Line Tool on Mac
- How to change directory in Git bash
- Get List of all local branches git command
- fix fatal: --local can only be used inside a git repository error
- [git] fatal: your current branch 'main' does not have any commits yet
- Git Revision Questions Before the Interview
- Change the default git branch name from master to main
- git command to remove/unstage files from staging area
- Remove git config at Local, Global or System Levels?
- [fix] fatal: this operation must be run in a work tree in git
- Clone a particular remote brach using git clone command
- How do I get a list of all branches in Git?
- How to check your installed version of Git
- Step-by-Step: How to delete a git branch from local as well as remote origin
- Git Commit - Author identity unknown, Please tell me who you are email
- fatal: Unable to create '/c/git_repo/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier.
- How to Rename a Git Local Branch Using the --move Option
- Perform an Empty Commit in Git without anything in Staging Area
- [Fixed] Git Clone git@github.com: Permission denied (publickey) Could not read from remote repository Fatal error
- GitHub: How to Search Code
- Rename git branch on Local and GitHub Remove using Command
More Posts:
- Notepad++ Happy vs Unhappy Versions - NotepadPlusPlus
- How to Sign Up for ChatGPT AI Chat Bot with Steps - HowTos
- Git Rename master branch make to main using Command - Git
- Turn off Auto-Capitalization on macOS Ventura 13 - MacOS
- Python: Convert int to binary String - Python
- [Fix] Cannot resolve No versions available for org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0) within specified range - Java
- 0xCAA20003: You ran into an authorization problem. [Microsoft] - Microsoft
- AADSTS90033: A transient error has occurred. Please try again. [Microsoft 365] - Microsoft