Languages
[Edit]
EN

Git - how to set username and email?

2 points
Created by:
Emrys-Li
580

1. Overview

Usually we configure global username and email address after installing Git.

We can also set configuration for single specific repository.

In this post we cover both configurations:

  1. global (all repositories)
  2. single repository

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

2. Git - set global username and email configuration

  1. Open command line (eg git bash)
  2. Set your username:
    git config --global user.name "FIRST_NAME LAST_NAME"
  3. Set your email address:
    git config --global user.email "OUR_NAME@example.com"
  4. Verify your configuration by showing username and email
    # show username
    git config user.name
    # show email
    git config user.email

3. Git - set username and email configuration for single repository

  1. Open command line (eg git bash) and change directory into specific repository
  2. Set your username:
    git config user.name "FIRST_NAME LAST_NAME"
  3. Set your email address:
    git config user.email "OUR_NAME@example.com"
  4. Verify your configuration by showing username and email
    # show username
    git config user.name
    # show email
    git config user.email

 

References

  1. Git config - Docs
  2. Getting Started - First-Time Git Setup
  3. Github - Setting your commit email addres

Alternative titles

  1. How to change username and email in git only for single local repository?
  2. Git - how to set user name and email?
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Git

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join