Harshit Vijayvargia
Harshit Vijayvargia

Reputation: 225

I added a wrong variable to git config. How do I remove it?

git config --list
credential.helper=osxkeychain
user.email=******
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
user.email==

The last variable "user.email==" is creating issue, how do I remove it ?

Upvotes: 1

Views: 5323

Answers (3)

Romain Valeri
Romain Valeri

Reputation: 21938

Use --unset for this. (doc)

git config [--global|--local] --unset user.email

As suggested by Richard in his comment, --show-origin will tell you whether to use --local or --global (global config is in <your user folder>/<your user name>/.gitconfig, local config in .git/config)

Upvotes: 2

Daniel Andrei Mincă
Daniel Andrei Mincă

Reputation: 5012

Try removing it via cli

git config --unset user.email
git config --global --unset user.email
git config --system --unset user.email

Or, to purge both of them

git config --unset-all user.email

Upvotes: 2

Simon Schrottner
Simon Schrottner

Reputation: 4754

It depends if this is a global setting, then you normally have a file called .gitconfig within your users home directory. Or you have an issue with your project settings, than you can find it within your project in .git/config.

You can edit those files with any kind of text editor and adapt/remove configuration in there.

Upvotes: 1

Related Questions