

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Git
incomplete
2: Install Git
incomplete
3: Command Syntax
incomplete
4: RTFM
incomplete
5: Porcelain and Plumbing
incomplete
6: Quick Config
incomplete
This lesson's interactive features are locked, please to keep using them
We need to configure Git to contain your information. Whenever code changes, Git tracks who made the change. To ensure you get proper credit (or more likely, blame) for all the code you write, you need to set your name and email.
Git comes with a configuration both at the global and the repo (project) level. Most of the time, you'll just use the global config.
Let's set your identity. Check if your user.name and user.email are already set using config get:
git config get user.name
git config get user.email
If they aren't, set them using config set. I recommend using your GitHub username and email.
git config set --global user.name "github_username_here"
git config set --global user.email "email@example.com"
Finally, let's set a default branch (we'll talk more about configs and branches later) so that we're all on the same page. Run:
git config set --global init.defaultBranch master
We're using master for now because it is Git's default, but later we'll change it to main, which is GitHub's default. Just bear with us for a second.
Your ~/.gitconfig file is the file that stores your global Git configuration. View it:
cat ~/.gitconfig
Run and submit the CLI tests.