πŸ“ Git & GitHub

Feature Branch Workflow: How Team Projects Work πŸ”€

0
Author
04e5cc8b-58ac-4bdc-bdee-661bbb
πŸ“…
Published
06.05.2026
⏱️
Reading time
3 min
πŸ‘οΈ
Views
43
🌱
Level
Beginner

Feature Branch Workflow is a team development approach where every task is done in a separate branch. It’s the most popular workflow in modern teams.

The Problem Without Branches

Imagine a team of three developers all working in main:

Morning:
  Ivan   β€” adding a login form
  Maria  β€” fixing a bug in the cart
  Alexey β€” building a new page

Lunch:
  Ivan pushes β†’ breaks Maria's code
  Maria pushes β†’ conflicts with Ivan
  Alexey watches the chaos β†’ can't work

Result: No one can work properly, main is constantly broken.

The Solution: Each Task Gets Its Own Branch

main  ──────────────────────────────────────────→

         Ivan: feature/login
              ──●──●──●──●──→ PR β†’ merge

         Maria: fix/cart-bug
                   ──●──●──→ PR β†’ merge

         Alexey: feature/catalog
                      ──●──●──●──→ PR β†’ merge

Everyone works independently. main is stable and always ready to deploy.

The Full Workflow

1. Start with an up-to-date main

git checkout main
git pull origin main  # get the latest changes

In GitHub Desktop: switch to main β†’ Fetch origin β†’ Pull.

2. Create a branch

git checkout -b feature/user-profile

In GitHub Desktop: Branch β†’ New Branch β†’ name your branch.

Naming conventions:

Type Pattern Example
New feature feature/name feature/user-profile
Bug fix fix/name fix/login-crash
Documentation docs/name docs/api-guide
Refactoring refactor/name refactor/auth-module

3. Work and commit

# Done part of the work
git add .
git commit -m "feat: add profile page"

# More changes
git commit -m "feat: avatar upload"

# Fixed something
git commit -m "fix: username validation"

4. Push the branch

git push origin feature/user-profile

In GitHub Desktop: Push origin (or Publish branch on first push).

5. Create a Pull Request

GitHub will show a banner: “Compare & pull request”. Click it.

Fill in the description:
- What was done
- Why
- How to test

6. Go through code review

Reviewer looks at the code and leaves comments.
You make changes and push β€” the PR updates.

7. Merge and delete the branch

After Approve: Merge pull request β†’ Delete branch.

# Locally: switch to main and update
git checkout main
git pull origin main
git branch -d feature/user-profile  # delete local branch

Multiple Tasks in Parallel

The main strength of Feature Branches is handling several tasks simultaneously:

# Working on the login feature
git checkout feature/login

# A critical bug came in β€” switch over
git checkout main
git checkout -b fix/critical-bug

# Fixed the bug, merged via PR
# Back to the login feature β€” nothing lost
git checkout feature/login

Without branches you’d have to stash or revert unfinished work.

Branch Lifecycle

Created from main  β†’  Work  β†’  PR  β†’  Review  β†’  Merge  β†’  Deleted
     ↑                                               ↓
     └──────────── Review fixes β†β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

A branch lives exactly as long as it’s needed. After merge β€” it’s deleted.

What If main Updated While I Was Working?

Another developer merged their PR while you were working in your branch.
You need to update your branch:

git checkout feature/my-feature
git merge main  # pull updates from main into your branch

In GitHub Desktop: Branch β†’ Update from default branch.

If there’s a conflict β€” see the article Resolving Merge Conflicts.

Rules of Good Practice

Small branches βœ…

feature/add-email-field  β†’ 50 lines changed β†’ 1 hour of review

vs

feature/redesign-everything β†’ 3000 lines β†’ reviewer cries

Small PRs get merged faster. Large ones “hang” for weeks.

One task β€” one branch βœ…

# Good: each task in its own branch
feature/add-login
feature/add-registration
fix/password-validation

# Bad: everything in one branch
feature/auth-system  # login, registration, fix, and refactoring all in one...

Descriptive branch names βœ…

The branch name should make its purpose clear:

βœ… feature/user-avatar-upload
βœ… fix/cart-total-calculation
❌ my-branch
❌ test
❌ new-stuff

Feature Branch in Different Teams

GitHub Flow (simple)

main β†’ feature branch β†’ PR β†’ merge into main β†’ deploy

Used in most small teams and open source projects.

Git Flow (complex)

main β†’ develop β†’ feature β†’ develop β†’ release β†’ main

Used in teams with defined release cycles.

For learning and most projects, GitHub Flow is sufficient.

Summary

Feature Branch Workflow means:

  1. Isolation β€” each task in its own branch
  2. Stability β€” main always works
  3. Review β€” code is checked before merge
  4. History β€” clear record of what was added and when

This is the approach used at most tech companies worldwide β€” from small startups to Google and Microsoft.

Your reaction to the article

πŸ’¬ Comments (0)

πŸ” Sign in to leave a comment
πŸšͺ Login
πŸ’­

No comments yet

Be the first to share your opinion about this article!

πŸ”— Similar

Similar articles

Continue learning with these materials

πŸ“

Git Hosting Platforms: Full Comparison πŸ†

GitHub, GitLab, Bitbucket β€” which one to choose? A complete comparison with up-to-date data.

πŸ“… 06.05.2026 πŸ‘οΈ 52
πŸ“

What Is a Git Commit and Why Do You Need It? πŸ“Έ

A commit is a saved snapshot of your project at a specific point in time...

πŸ“… 06.05.2026 πŸ‘οΈ 56
πŸ“

Why Git won over every other version control syst…

Today Git is the de facto standard for version control in software development. But it...

πŸ“… 06.05.2026 πŸ‘οΈ 51

Did you like the article?

Subscribe to our updates and receive new articles first. Grow with PyLand!