World map

 

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

git log on main. The two newest commits are quick menu change and WIP search, do not ship. Terminal output: $ git log --oneline aac4bca (HEAD -> main) quick menu change c9721cb WIP search, do not ship 7f52479 Add cart 67e914a Add menu page

Your team commits straight to main. Look at the top two commits. Half-done work is now on the live site.

Watch

Two commits, Add search box and Style search box, wait on your branch. Then they slide into main, after Add menu page.

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

Try it

Try it for real on your diary repo. Tick each step as you go.

Real mission

  1. git switch -c docs/about-line
  2. git commit -am "docs: add about line"
  3. git push -u origin docs/about-line
  4. git switch main
  5. git pull
  6. git branch -d docs/about-line

0 of 7 steps done · Your ticks are saved.

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.

1 / 6

One branch for one change

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.