Setup Git Username/Email

Configure your Git username/email

You typically configure your global username and email address after installing Git. However, you can do so now if you missed that step or want to make changes. After you set your global configuration, repository-specific configuration is optional.

Git configuration works the same across Windows, macOS, and Linux.

To set your global username/email configuration:

  1. Open the command line.
  2. Set your username:
    git config –global user.name “FIRST_NAME LAST_NAME”
  3. Set your email address:
    git config –global user.email “MY_NAME@example.com”

To set repository-specific username/email configuration:

  1. From the command line, change into the repository directory.
  2. Set your username:
    git config user.name “FIRST_NAME LAST_NAME”
  3. Set your email address:
    git config user.email “MY_NAME@example.com”
  4. Verify your configuration by displaying your configuration file:
    cat .git/config

Close Menu