Skip to content

Instantly share code, notes, and snippets.

@vanpeerdevelopment
Created January 28, 2014 18:52
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save vanpeerdevelopment/8673769 to your computer and use it in GitHub Desktop.
Save vanpeerdevelopment/8673769 to your computer and use it in GitHub Desktop.
Command to remove a git configuration.
# Remove repository configuration
git config --unset [key]
# Remove global configuration
git config --global --unset [key]
# Remove system configuration
git config --system --unset [key]
@Franks-Joseph
Copy link

What the heck does [key] mean?

@olakehinde
Copy link

@Franks-Joseph [key] here refers to the property you are trying to unset (or remove). For example, if you want to unset/remove the 'username' property, then the [key] will be 'user.name'. So that the command becomes: git config --global --unset user.name

@mkasimd
Copy link

mkasimd commented Oct 25, 2019

As a little sidenote, in case you have multiple entries with the same key and want to remove them all, you should use unset-all instead of unset.

@KulaGGin
Copy link

KulaGGin commented Jun 24, 2020

@Franks-Joseph, to see the keys, run git config --global --list or --local - for local settings respectively. It will be entries such as core.autocrlf, merge.tool=bc and other, depending on what you set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment