Remove git config at Local, Global or System Levels?


Remove a value from git config file

In order to remove a set value from git config file, you can make use of the --unset option along with the config command.

git config --unset [--local|--global|--system] value

Example:
# git config --list --show-origin
file:/etc/gitconfig     core.editor=nano -w
file:/home/neo/.gitconfig       user.email=you@example.com
file:/home/neo/.gitconfig       user.name=Neo
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=true
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        dev.name=Mike

Let us try to unset dev.name at the local level.

# git config --unset  --local dev.name
git config --list
core.editor=nano -w
user.email=you@example.com
user.name=Neo
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
-


Have Questions? Post them here!

Topics Coverage:


🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram