World map

 

BM: Baca dalam Bahasa Melayu

World 0: Start Here

Tell Git who you are

You will learn: how to give Git your name, your email and a few good settings.

The problem

git log shows the newest commit. The Author line says: You, you@example.com. Terminal output: $ git log -n 1 commit 3a127973b8a397d4694ab507cf9116d7098f6208 (HEAD -> main) Author: You <you@example.com> Date: Fri Oct 30 09:02:00 2026 +0800 Add home page

Every commit is signed with a name and an email. This one just says “You”. Git can’t guess who you are.

Watch

The first command saves the name Aiman Hakim. The second one prints it back. Terminal output: $ git config --global user.name "Aiman Hakim" $ git config --global user.name Aiman Hakim

git config changes Git’s settings, called config: Git's settings, like your name and email.. This one saves your name. --global means: for all your projects.

Try it

Build the command that saves your email. Tap the pieces in order.

Tap the pieces in the right order.

…

Try it

Now set your own name and email here.

Your email shows on every commit. Use one you are happy to share.

Watch

After setting init.defaultBranch to main, git init makes a new project called diary. Terminal output: $ git config --global init.defaultBranch main $ git init diary Initialized empty Git repository in /home/you/diary/.git/

Each project starts with one branch: A storyline of commits. Each branch has a name, like main., a line of save points. This setting names it main. git init diary makes a new project to test it.

Watch

core.editor is set to code --wait. The list shows every setting. Terminal output: $ git config --global core.editor "code --wait" $ git config --global --list core.editor=code --wait

Sometimes Git opens an editor for you to type in. This picks VS Code. --wait makes Git wait until you close it. --list shows all your settings.

Predict

Settings have three levels: system, global and local. Local is for one project. Your global email is home@example.com. One project sets a local email: work@example.com. Which one does that project use?

Pick one answer.

Try it

Your turn, for real. Do this on your own computer. Copy each line into your terminal.

Quick win: your first real commit

  1. git config --global user.name "Your Name"
  2. git config --global user.email "you@example.com"
  3. git config --global init.defaultBranch main
  4. mkdir my-first-repo
  5. cd my-first-repo
  6. git init
  7. echo "Hello Git" > hello.txt
  8. git add hello.txt
  9. git commit -m "Add hello file"
  10. git log --oneline

0 of 11 steps done · Your ticks are saved.

You did it!

You can now set up Git and make a real commit.

Go deeper (optional)

git config --list --show-origin shows each setting and the file it lives in. --system changes settings for everyone on the computer. On a Mac, code --wait needs the code command. Add it from VS Code’s Command Palette.