Trending
| 8:18 AM IST
A Simple Git Workflow for Teams: GitHub Flow, Step by Step (Part 16)
Tech

A Simple Git Workflow for Teams: GitHub Flow, Step by Step (Part 16)

Put branches, pull requests and reviews together into one simple team routine: GitHub flow. Add collaborators, protect main and follow daily habits that prevent chaos. Part 16 of our Git series.

By · 8 min read 1 view Rate it 0 comments

The simplest Git workflow for teams is GitHub flow: main always stays working; every change starts on a new branch; work is shared through a pull request; a teammate reviews it; and it is merged and deployed. Add branch protection so nobody can push to main directly, and a small team can work together smoothly.

Word spread about the bakery website. Within two months, Sneha had more requests than she could handle alone, so she teamed up with two college friends, Ravi and Anu, to form a small web studio in Guntur. Their first big client was a local hospital. On day three, Ravi pushed a change straight to main that overwrote Anu's work from the morning. Nobody had done anything "wrong"; they simply had no agreed way of working. That evening they sat down with chai and agreed on GitHub flow. You now know all the pieces: branches, merging, pull requests and forks. This Part 16 closes Module 4 by fitting them into a routine any small team can follow.

Your one-minute summary

  • GitHub flow: branch → commit → pull request → review → merge → deploy
  • main is always deployable
  • Invite teammates as collaborators (or use an organisation)
  • Protect main with branch protection rules
  • Agree on naming, commit messages and PR size
  • Daily habit: pull in the morning, push before you leave

What is GitHub flow?

GitHub flow is a lightweight, branch-based workflow described in GitHub's own documentation. It has few rules, which makes it ideal for small teams and websites that are updated often.

GitHub flow in six steps

1. Create a branchFrom an up-to-date main: feature/doctor-profiles
2. Make commitsSmall, clear commits as you work
3. Open a pull requestEarly, even as a draft, to share progress
4. Review and discussA teammate comments and approves
5. MergeThe change joins main
6. Deploy and delete branchMain goes live; the branch is cleaned up

Repeat for every feature, fix or content change, however small.

How do I set up a repository for a team?

Before the first branch, spend 15 minutes setting up the repository properly.

Team repository setup

Invite collaboratorsRepository Settings, Collaborators, Add people. For a studio, create a free GitHub organisation and add members to teams
Add a README and .gitignoreHow to run the project and what not to commit (Parts 10 and 17)
Protect the main branchSettings, Branches (or Rules), add a rule for main
Require pull requests and approvalsAt least one approval before merging
Agree on conventionsBranch names, commit style and who reviews what
Also readYour First Git Repository and First Commit, Step by Step (Part 7)

What is branch protection, and why use it?

Branch protection rules stop accidents like Ravi's. With a rule on main, GitHub can refuse direct pushes, require a pull request, require one or more approvals and require automatic checks to pass before anything is merged. GitHub explains the options in its guide to protected branches.

RuleWhat it preventsRecommended for beginners?
Require a pull request before mergingDirect, unreviewed pushes to mainYes
Require approvals (1)Merging without a second pair of eyesYes, for teams of 2+
Require status checks to passMerging code that fails automatic testsYes, once you add Actions (Part 19)
Block force pushesRewriting main's historyYes
Restrict deletionsDeleting main by mistakeYes
Note on plansBranch protection is available on public repositories with GitHub Free. For private repositories, some protection features depend on your plan; check GitHub's documentation for the current details.

What does a real team day look like?

One day at Sneha's studio, with GitHub flow

9:30 am: everyone pulls maingit switch main and git pull; all start from the same version
10:00 am: three branchesSneha: feature/doctor-profiles · Ravi: fix/appointment-form · Anu: content/new-timings
1:00 pm: Anu opens a PRSmall content change; Sneha reviews and approves in 10 minutes; merged
4:00 pm: Ravi's PR gets feedbackSneha asks for phone-number validation; Ravi pushes one more commit; approved; merged
6:00 pm: Sneha pushes a draft PRDoctor profiles are half done; the draft shares progress without risk

Nobody waited for anyone, nobody overwrote anyone and main stayed working all day.

What rules should a small team agree on?

The studio's team agreement

  • Never push directly to main; always use a pull request
  • Branch names: feature/, fix/, content/ plus a short description
  • Commit messages start with a verb: Add, Fix, Update, Remove
  • Keep pull requests small; split big features
  • Every PR has a description, testing steps and screenshots for visual changes
  • Review within one working day
  • Delete branches after merging
  • Pull main every morning; push before you leave

How is GitHub flow different from Git flow?

You may hear of "Git flow", an older and more structured model. It uses long-lived main and develop branches plus special release and hotfix branches. It suits software with planned version releases, such as mobile apps. For websites that update frequently, GitHub flow is simpler and usually enough.

Two popular workflows

GitHub flow

  • One long-lived branch: main
  • Short feature branches and PRs
  • Deploy often, even daily
  • Best for websites, small teams and beginners

Git flow

  • main plus develop, release and hotfix branches
  • More ceremony and planning
  • Planned, versioned releases
  • Best for products with formal release cycles

How do teams communicate on GitHub?

Where conversations belong

IssuesTasks, bugs and client requests (Part 17)
PR commentsTechnical discussion next to the code
@mentions"@ravi could you check the form on mobile?"
ProjectsWho is working on what (Part 17)

What are common team problems and fixes?

ProblemLikely causeFix
Frequent merge conflictsLong-lived branches, large PRsSmaller PRs, merge daily, pull main into branches
Main breaks oftenDirect pushes, no reviewBranch protection, required approvals, Actions checks
PRs wait for daysNo review ownerAgree a review rota and response time
Nobody knows what is in progressWork tracked in chats onlyIssues and a Projects board

Before Part 17, make sure you can

  • List the six steps of GitHub flow
  • Invite a collaborator to a repository
  • Add a branch protection rule to main
  • Write a short team agreement
  • Explain when Git flow might be a better fit

Her View

A good workflow is really about respect: for teammates' time, for the client's live website and for the shared work. Clear rules remove awkwardness, so nobody has to ask "did you just overwrite my changes?". When everyone follows the same rhythm, teams feel calmer, kinder and more confident, and friendships survive working together.

Also readHow to Install Git, VS Code and GitHub Desktop on Windows and Mac (Part 5)

His Insight

Start with the lightest process that works: GitHub flow, one required approval and protection on main. Add automatic checks once you have them. Watch two things informally: how long PRs wait for review and how often main breaks. If either grows, tighten the process; if neither does, keep it simple.

H View Verdict

GitHub flow turns everything you have learned into a calm, repeatable team routine. Protect main, work on branches, review through pull requests and merge often. That completes Module 4. In Module 5, we explore GitHub beyond code, starting in Part 17 with README files, Issues and Projects.

Self-assessment: test yourself

Ready? Tap an option for each question. You will see right away whether you got it, with a short explanation, and your score at the end. Take your time, and try again as often as you like.

Team workflow quiz: 10 questions

1. In GitHub flow, main should always be

  1. Empty
  2. Working and deployable
  3. Experimental
  4. Deleted after each release

Only reviewed, working changes reach main.

2. Which setting stops people pushing directly to main?

  1. .gitignore
  2. Branch protection rule requiring pull requests
  3. Making the repo public
  4. git stash

Branch protection can require all changes to arrive through PRs.

3. What is the first step of GitHub flow?

  1. Merge
  2. Deploy
  3. Create a branch
  4. Delete main

Every change starts on a new branch from an up-to-date main.

4. Git flow is best suited for

  1. A personal blog
  2. Products with planned, versioned releases
  3. One-page websites
  4. Learning Git

Git flow's release branches suit formal release cycles.

5. What helps most to reduce merge conflicts in a team?

  1. Larger pull requests
  2. Small PRs merged often
  3. Fewer commits
  4. Force pushing

Small, frequent merges keep branches close to main.

6. What caused the problem on day three at Sneha's studio?

  1. A slow laptop
  2. A direct push to main with no agreed workflow
  3. A virus
  4. GitHub was down

Without rules, a direct push overwrote a teammate's work.

7. Where do you invite a teammate to a repository?

  1. In the README
  2. Settings, then Collaborators
  3. In a commit message
  4. Through git push

Collaborators are added in the repository settings.

8. What is a good daily team habit?

  1. Never pull
  2. Pull main in the morning, push before leaving
  3. Push only on Fridays
  4. Work only on main

This keeps everyone in sync and work backed up.

9. How do you notify a teammate in a PR comment?

  1. Use CAPITAL LETTERS
  2. Use an @mention, like @ravi
  3. Delete the PR
  4. Push to main

@mentions send notifications to that person.

10. How many approvals work well for a small team?

  1. Zero
  2. One
  3. Five
  4. Everyone in the company

One approval adds a second pair of eyes without slowing work.

Frequently asked questions

Do I need GitHub flow if I work alone?

A light version helps: branch, pull request and merge. It gives you a review step and clean history, and makes adding a teammate later easy.

How do I add someone to my repository?

Open the repository, go to Settings, then Collaborators, and invite them by username or email. They must accept the invitation.

Should clients have access to the repository?

Often read access is enough, so they can see progress. Many freelancers share pull request links or a staging site instead of repository access.

How many approvals should a team require?

One approval works well for small teams. Larger or more sensitive projects may require two.

Part 16 of 20 in our Git and GitHub for Beginners series, and the end of Module 4. A small tip from us: write your team agreement on one page and pin it in your repository's README. Next up, Part 17: README files, Issues and Projects on GitHub.
Topics: Tech
Harika Behara

Writes for H View, where every story follows our editorial policy and is reviewed before it is published.

All stories by Harika →

H View stories follow our editorial policy. Spotted an error? Tell us and we will correct it.

Rate this article

One tap is enough. No comment needed.

Your rating
Be the first to rate it.

Was this article helpful?

Your answer goes straight to our editors.

Comments0

Be kind and stay on topic. Comments with links are checked before they appear.

No comments yet. Start the conversation.

The H View Brief

Our best stories, in your inbox.

The week’s best Her View, His Insight reading in one short, useful note.

Free. We only use your email to send The H View Brief. Unsubscribe any time.