Git: Set local user.name and user.email different for each repo

You can confirm that by printing on the terminal:

  1. Global user:git config --global user.name
  2. Local user: git config user.name

For just one repo, go into to the relevant repo DIR and:

git config user.name "Your Name Here"
git config user.email [email protected]

For (global) default email (which is configured in your ~/.gitconfig):

git config --global user.name "Your Name Here"
git config --global user.email [email protected]

You can check your Git settings with: git config user.name && git config user.email

If you are in a specific repo which you setup a new user/config for (different to global) then it should show that local config, otherwise it will show your global config.


...or just edit the .git\config file and add these three lines somewhere:

[user]
    name = YourName
    email = [email protected]

Tags:

Git

Github