BM: Baca dalam Bahasa Melayu
World 6: Team Workflows
GitHub Flow
You will learn: the short branch, PR and merge loop that many teams use.
The problem
Your team commits straight to main. Look at the top two commits. Half-done work is now on the live site.
Watch
GitHub Flow: A simple team loop: short branch off main, pull request, review, merge. keeps main safe. Each change gets its own short branch. It joins main only when it is ready.
Watch
Tap each point on the timeline.
Six steps, then start again. A branch lives for hours or days, not months. Main is always ready to ship.
Try it
Put the GitHub Flow steps in order.
First step at the top. Put these in order. Use the arrows, or drag.
- Merge into main
- Make a branch off main
- Delete the branch
- Open a pull request
- Fix review comments
- Commit and push
Hint
It starts with a branch. It ends with a clean-up.Try it
Try it for real on your diary repo. Tick each step as you go.
Real mission
git switch -c docs/about-linegit commit -am "docs: add about line"git push -u origin docs/about-linegit switch maingit pullgit branch -d docs/about-line
0 of 7 steps done · Your ticks are saved.
Hint
No diary repo on GitHub yet? World 4 shows how. You can skip this card.Predict
Your PR is approved and merged. What is true about main now?
Pick one answer.
Check
Good GitHub Flow habit? Swipe right if yes, left if not.
Swipe right for good, left for needs work. Or use the buttons.
One branch for one change
You did it!
You can now ship a change with GitHub Flow.
Go deeper (optional)
Many hosting services build a preview site for each PR. Your team can click around before merging. Also protect main with a rule: no direct pushes. World 5 shows how. GitHub’s own guide lists the same six steps.
Bahasa Melayu
Pasukan anda commit (titik simpan) terus ke main. Tengok dua commit paling atas. Kerja separuh siap kini ada di laman web yang live.
GitHub Flow jaga main supaya selamat. Setiap perubahan dapat branch (cabang) pendek sendiri. Ia masuk ke main hanya bila dah siap.
Enam langkah, kemudian ulang. Satu branch hidup beberapa jam atau hari, bukan berbulan. Main sentiasa sedia untuk dihantar.
Susun langkah GitHub Flow ikut turutan.
Cuba betul-betul pada repo diari anda. Tanda setiap langkah bila siap.
PR anda dah diluluskan dan di-merge. Apa yang betul tentang main sekarang?
Tabiat GitHub Flow yang bagus? Leret ke kanan kalau ya, ke kiri kalau tidak.
Kini anda boleh hantar perubahan dengan GitHub Flow.
You finished this before. Practice is always welcome!
Official docs: git switch · GitHub flow · About pull requests
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?