World map

 

BM: Baca dalam Bahasa Melayu

World 1: Save Points

Your first save point

You will learn: how to make a commit, and what is inside one.

The problem

index.html has a green tick in the working folder. The repository holds only one commit: Add README.

Tonight your home page works. Tomorrow you might break it. Can you get tonight’s version back? Only with a save point.

Watch

Camera flash. index.html leaves the box and a new commit, Add home page, lands in the repository.

git commit takes a snapshot: a full photo of the box, right now. The words after -m are a short note about it.

Try it

Save index.html as a new commit.

Working folder
Staging area
  • Empty
Repository
  • 1 save point
  • Add README
6d3a9b1

Watch

git log shows two commits, newest first. Each has a long code, an author, a date and a message. Terminal output: $ git log commit e9e6425fe682d4e9e3c76b84e4da6a3be9cb459f (HEAD -> main) Author: You <you@example.com> Date: Fri Oct 30 09:02:00 2026 +0800 Add home page commit 6d3a9b115cdb7b7a74eab7cb29b0a98526fb9777 Author: You <you@example.com> Date: Fri Oct 30 09:01:00 2026 +0800 Add README

git log lists your commits, newest first. The long code after “commit” is the hash. It is that commit’s unique name.

Watch

A new commit dot appears on the timeline. A line links it back to the older Add README dot.
6d3a9b1

Each new commit points back to the one before it. That older commit is its parent. Together they make your timeline.

Check

Which one is NOT saved inside a commit?

Pick one answer.

Try it

Now do it for real, on your own computer. Type each command yourself. Copy only if you get stuck.

Real mission

  1. mkdir real-diary
  2. cd real-diary
  3. git init
  4. echo "<h1>My Diary</h1>" > index.html
  5. git add index.html
  6. git commit -m "Add home page"
  7. git log

0 of 8 steps done · Your ticks are saved.

You did it!

You can now make a commit and read it in git log.

Go deeper (optional)

git show prints the newest commit and exactly what changed in it. Want a longer note? Add a second -m. The first one becomes the title, the second the body.

git show: the Add home page commit, then the two new lines of index.html in green. Terminal output: $ git show commit e9e6425fe682d4e9e3c76b84e4da6a3be9cb459f (HEAD -> main) Author: You <you@example.com> Date: Fri Oct 30 09:02:00 2026 +0800 Add home page diff --git a/index.html b/index.html new file mode 100644 index 0000000..a8ad0de --- /dev/null +++ b/index.html @@ -0,0 +1,2 @@ +<h1>My Diary</h1> +<p>Day 1: I learned Git.</p>