Setting git user globally or for given repository

This is just a quick note to future self about operations on git user and emails address.

1. Read current setting for given repository:

cd template-repository
git config user.name
git config user.email

2. Read global settings (affects all new repositories on given PC):

git config --global user.name
git config --global user.email

3. Change current setting for given repository:

cd template-repository
git config user.name "johnny.bravo"
git config user.email "johnny.bravo@cartoonnetwork.com"

4. Change global settings (affects all new repositories on given PC):

git config --global user.name "johnny.bravo"
git config --global user.email "johnny.bravo@cartoonnetwork.com"

You may also want to read about setting your commit email address, setting your username in Git or blocking command line pushes that expose your personal email address in GitHub Help guide.

If you wish to check or change your GitHub user in PhpStorm then Ctrl+Alt+S ā†’ GitHub ā†’ Enter.

Reviewing your current email settings in GitHub can also sound like a good idea.

Leave a Reply