Hunsu
Hunsu

Reputation: 3381

How to remove a filter from 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.

Upvotes: 4

Views: 2802

Answers (2)

VonC
VonC

Reputation: 1323553

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.

Upvotes: 6

Frederic Henri
Frederic Henri

Reputation: 53713

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

Upvotes: 1

Related Questions