Menu
Coddy logo textTech

Configure Your Identity

Part of the Version Control section of Coddy's Terminal journey — lesson 6 of 58.

Every commit is signed with a name and email. Before you can make your first commit, Git needs to know who you are. You set this once, globally, with git config:

git config --global user.name "Ada Lovelace"
git config --global user.email "ada@example.com"

The --global flag means the setting applies to every repository on your machine. Without it, the setting only applies to the current repo.

You can read a setting back with the same command, omitting the value:

git config --global user.name
Ada Lovelace

The name and email show up next to every commit you make, so use something you are happy to publish.

challenge icon

Challenge

Beginner

Set the global Git username to Coddy Learner and the email to learner@coddy.tech.

Then print both values back, each on its own line, in this order: name first, email second.

Cheat sheet

Set global Git identity (required before first commit):

git config --global user.name "Ada Lovelace"
git config --global user.email "ada@example.com"

Read a setting back by omitting the value:

git config --global user.name
Ada Lovelace

--global applies the setting to all repositories on your machine; without it, the setting only applies to the current repo.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Version Control