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 LovelaceThe name and email show up next to every commit you make, so use something you are happy to publish.
Challenge
BeginnerSet 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
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Version Control
2Getting Started
Initialize A RepositoryThe .git FolderConfigure Your IdentityGit StatusRecap - First Repo8Merging
What Is A MergeFast-Forward MergeThree-Way MergeMerge ConflictsResolve A ConflictRecap - Merge Master11Feature Branch Project
Project OverviewInitialize Main3Tracking Changes
The Staging AreaGit AddGit CommitModifying A Tracked FileGit LogRecap - First Commits6Recipe Site Project
Project OverviewInitialize And Ignore