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
Every commit is signed with a name and an email. This one just says “You”. Git can’t guess who you are.
Watch
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.
Hint
It looks like the name command. Swap the setting and the value.Try it
Now set your own name and email here.
Your email shows on every commit. Use one you are happy to share.
Hint
Put your name in quotes, like"Aiman Hakim".Watch
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
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
git config --global user.name "Your Name"git config --global user.email "you@example.com"git config --global init.defaultBranch mainmkdir my-first-repocd my-first-repogit initecho "Hello Git" > hello.txtgit add hello.txtgit commit -m "Add hello file"git log --oneline
0 of 11 steps done · Your ticks are saved.
Hint
Stuck? Check each line is typed exactly. Spaces and quotes matter.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.
Bahasa Melayu
Setiap commit (titik simpan) ditandatangani dengan nama dan e-mel. Yang ini cuma tulis “You”. Git tak boleh teka siapa anda.
git config tukar tetapan Git, dipanggil config (tetapan). Yang ini simpan nama anda. --global maksudnya: untuk semua projek anda.
Bina arahan yang simpan e-mel anda. Ketik kepingan mengikut urutan.
Sekarang tetapkan nama dan e-mel anda sendiri di sini.
E-mel anda akan nampak pada setiap commit. Guna e-mel yang anda selesa kongsi.
"Aiman Hakim".Setiap projek bermula dengan satu branch (jalan cerita), iaitu barisan titik simpan. Tetapan ini namakannya main. git init diary buat projek baru untuk mengujinya.
Kadang-kadang Git buka editor (penyunting) untuk anda menaip. Tetapan ini pilih VS Code. --wait buat Git tunggu sampai anda tutupnya. --list tunjuk semua tetapan anda.
Tetapan ada tiga peringkat: system, global dan local. Local untuk satu projek sahaja. E-mel global anda home@example.com. Satu projek ada e-mel local: work@example.com. Projek itu guna yang mana?
Giliran anda, betul-betul. Buat ini dalam komputer anda sendiri. Salin setiap baris ke terminal anda.
Kini anda boleh sediakan Git dan buat commit sebenar.
You finished this before. Practice is always welcome!
Official docs: git config · git init · git commit
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?