BM: Baca dalam Bahasa Melayu
World 1: Save Points
Make a repo
You will learn: how to make Git start watching a folder.
The problem
You made a diary website. You want save points. But Git doesn’t even know this folder exists!
Watch
git init tells Git: “Watch this folder.” Now the folder is a repository. Most people say repo.
Try it
Make your diary a repo. Then find the hidden folder.
Hint
First typegit init. Then type ls -a.Predict
You delete the .git folder. What happens?
Pick one answer.
Check
Plain ls did not show .git. Why not?
Pick one answer.
You did it!
You can now turn any folder into a Git repo.
Go deeper (optional)
Run git init once per project, inside the project folder. Never in your home folder! Running it twice is safe: Git just says “Reinitialized”. Your first branch: A storyline of commits. Each branch has a name, like main. gets its name from the init.defaultBranch setting. Git 3.0 will use main by default.
Bahasa Melayu
Anda dah buat laman web diari. Anda nak ada titik simpan. Tapi Git tak tahu pun folder ini wujud!
git init suruh Git jaga folder ini. Kini folder itu sebuah repository (folder projek yang Git jaga). Ringkasnya, repo.
ls -a senaraikan semua fail, termasuk yang tersembunyi. Nampak .git? Itulah folder .git. Git simpan semua titik simpan di dalamnya.
Jadikan diari anda sebuah repo. Kemudian cari folder tersembunyi itu.
git init. Kemudian taip ls -a.Anda padam folder .git. Apa yang jadi?
Arahan ls biasa tak tunjuk .git. Kenapa?
Kini anda boleh jadikan mana-mana folder sebuah repo Git.
You finished this before. Practice is always welcome!
Official docs: git init · gitglossary (repository)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?