Gangmax Blog

Update Git Configuration

As I knew, I could add git config by the following commands:

1
2
3
4
5
# Add "local" config.
git config user.email "your_email@abc.example"

# Add "global" config.
git config --global user.email "your_email@abc.example"

What about removing a configuration item? A simple answer is using the following commands(from here):

1
2
3
4
5
# Update(include removing) "local" config.
git config --edit

# Update "global" config.
git config --global --edit

The two commands start an editor app(such as “vi” or “Sublime Text”, depends on your local setting) to open the configuration files:

  1. Local: “.git/config”

  2. Global: “~/.gitconfig”

In another word, you can edit the configuration files directly to “add/update/remove” the configuration items.

Comments