Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a filter from Git

Tags:

git

I want to remove a filter that added to Git. The command git config --list shows the filter I added

filter.spabs.clean=expand --initial -t 4
filter.spabs.smudge=expand --initial -t 4
filter.spabs.required

How can I remove it? Where does Git store the filters? I have verified .gitconfig and I don't have a .git/info/attributes file.

like image 402
Hunsu Avatar asked Mar 14 '23 19:03

Hunsu


2 Answers

For removing in all config files (without having to look for the key):

git config --unset-all filter.spabs.clean
git config --unset-all filter.spabs.smudge
git config --unset-all filter.spabs.required

As illustrated in "git credential.helper=cache never forgets the password?", you can do a:

sudo git config --system --unset-all filter.spabs.clean
sudo git config --system --unset-all filter.spabs.smudge
sudo git config --system --unset-all filter.spabs.required

That would remove those keys from /etc/gitconfig.

like image 75
VonC Avatar answered Mar 18 '23 06:03

VonC


so you need to know where they are defined, rather than git config --list you can run the 2 commands

git config --local --list
git config --global --list

For local filters, you need to look under .git/config file

For global filters, you need to look under ~/.gitconfig file

like image 41
Frederic Henri Avatar answered Mar 18 '23 06:03

Frederic Henri