BM: Baca dalam Bahasa Melayu
World 3: Parallel Universes
Fast-forward merge
You will learn: how a finished branch joins main when main has nothing new.
The problem
Your about page is finished on its branch. But main doesn’t have it yet. How do they join?
Watch
On main, git merge about brings the about work in. main has nothing new, so Git just slides the note forward. That’s a fast-forward: A merge where Git just slides your branch forward. No new commit..
Watch
Look for the word Fast-forward. Git made no new commit. One note just moved.
Try it
You are on main. merge: Join two storylines into one. about into it.
Hint
Typegit merge about, then press Enter.Predict
After a fast-forward, how many new commits did Git make?
Pick one answer.
Check
Where is main now?
Tap the commit main points at now.
You did it!
You can now merge with a fast-forward.
Go deeper (optional)
git merge --ff-only about merges only if it can fast-forward. If not, it stops safely. git merge --no-ff about always makes a merge commit. Some teams like that, so the branch shows up in history.
Bahasa Melayu
Halaman about anda dah siap di branch sendiri. Tapi main belum ada lagi. Macam mana nak gabungkan?
Di main, git merge about bawa masuk kerja about. main tiada apa yang baru, jadi Git cuma luncurkan nota ke depan. Itulah fast-forward.
Cari perkataan Fast-forward. Git tak buat commit baru. Cuma satu nota yang bergerak.
Anda di main. Merge (cantum) about ke dalamnya.
git merge about, kemudian tekan Enter.Selepas fast-forward, berapa commit baru yang Git buat?
Di mana main sekarang?
Kini anda boleh merge dengan fast-forward.
You finished this before. Practice is always welcome!
Official docs: git merge
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?