Last Updated: December 29, 2022
· Chao Yang

Local & Global git config.

There are 2 git config we can use, local & global. If you have multiple git servers as me, you need to config your git as per folder bases. Or you can use global config.
For local git repo config, use:

git config "your-user-name"
git config "your-email-addr"

This will result in [user] section added to .git/config file:

name = your-user-name
email = your-email-addr

You can use global config also if you only have one git server.

git config --global "your-user-name"
git config --global "your-email-addr"

Then the [user] section will be present at ~/.gitconfig, with the same content as in the .git/config file.