DEV Community

Stefi Rosca
Stefi Rosca

Posted on • Updated on • Originally published at stefirosca.netlify.app

🧰 Setting up your username and email in Git at your first dev job

Before and after example with image and name from profile

One of the things I had to do when getting my first job was configuring Git. Unless you setup your name and email address Git will take it from the environment. This is important because every Git commit uses this information and if it's not setup correctly it will not be linked to your Github account. Hence if you have a profile picture it won't show.

There are 2 ways to do it:

1. Globally

Open the command line and run the following commands with your name and email.

To setup your username:

$ git config --global user.name "Stefi Rosca"
Enter fullscreen mode Exit fullscreen mode

To setup your email:

$ git config --global user.email "stefi.rosca@me.com"
Enter fullscreen mode Exit fullscreen mode

In this case you only have to do it once and Git will always use this information for anything you do on that system.

2. Repository-specific

From the command line, change into a repository directory where you want to make this change and then run the commands as below.

To setup your username:

git config user.name "Stefi Rosca"
Enter fullscreen mode Exit fullscreen mode

To setup your email address:

git config user.email "stefi.rosca@me.com"
Enter fullscreen mode Exit fullscreen mode

To test that you set it up correctly you can run in your in a specific Git terminal git config user.email.

Make sure you change the name and email in the example above to yours.

For more information check out chapter on Getting Started from the Pro Git book

Top comments (3)

Collapse
 
turry profile image
Turry

Thanks, will do in the future.

Collapse
 
turry profile image
Turry

Hi, I have out this into good use now! Thank you!

Collapse
 
stefirosca profile image
Stefi Rosca

Congrats 🥳