Git Settings

Setting your email in Git

The git config command can be used to change your Git configuration settings, including your email address and name.

Setting your email address globally for every repository on your computer

  1. Open Terminal (for Mac and Linux users) or the command line (for Windows users).
  2. Set your email address with the following command:
    git config --global user.email "your_email@example.com"
    
  3. Confirm that you have set your email address correctly with the following command.
    git config --global user.email 
    # your_email@example.com

Setting your email address for a single repository

You may need to set a different email address for a single repository.

  1. Open Terminal (for Mac and Linux users) or the command line (for Windows users).
  2. Change the current working directory to the local repository in which you want to set your Git config email.
  3. Set your email address with the following command:
    git config user.email "your_email@example.com"
    
  4. Confirm that you have set your email address correctly with the following command.
    git config user.email
    # your_email@example.com
    

Similarly user.name can be configured. GitHub uses the email address you set in your local Git configuration to associate commits with your GitHub account.

Your email address will be visible on commits to GitHub. If you’d like to keep your email address private, set your Git config email to username@users.noreply.github.com instead.

Advertisements

One thought on “Git Settings

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: