Git Install & Configure

Set up Git with your name and email.

✍️ 2 exercises in this lesson
  1. Download Git from git-scm.com and install it (Windows includes "Git Bash").
  2. Set your identity. It is attached to every commit you make.
  3. Optionally set the default branch name and your editor.

--global applies the setting to every repository on your computer.

Key Takeaways: Git Install & Configure

Mastering Git Install & Configure helps you write clean and reliable Git code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.

Git Install & Configure Code Example

Git
git config --global user.name "Ali Khan"
git config --global user.email "ali@example.com"
git config --global init.defaultBranch main
git config --global core.editor "code --wait"

git config --list
Output
user.name=Ali Khan
user.email=ali@example.com
init.defaultbranch=main
core.editor=code --wait
Run this example on your own computer. The "Get Started" lesson shows how to set it up.

Git Install & Configure Practice Exercises

Check what you learned in “Git Install & Configure”.

/ 2 solved
Fill in the blank

Set your name for all repositories.

git config  user.name "Ali Khan"
✓ Correct! Not quite. Try again.
Multiple choice

Why should you set user.name and user.email?

✓ Correct! Not quite. Try again.
to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

Stuck on something?

Ask the community in the CodesInTech forum.

Need a developer?

Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.

Explore Our Services