DEV Community

Jasper Aurelio Villas
Jasper Aurelio Villas

Posted on

Branch Flow with Pull Requests

πŸ—ΊοΈ Branch Flow with Pull Requests (PRs)
Let's assume your repo has these main branches:

css

main         ← 🟒 production / stable
acceptance   ← 🟑 staging / testing
backend      ← πŸ”΅ backend dev
frontend     ← πŸ”΅ frontend dev
feature/*    ← πŸ”§ feature branches
documentation← πŸ“„ docs-only changes
Enter fullscreen mode Exit fullscreen mode

πŸ”„ Typical Flow (Push β†’ PR β†’ Merge):

plaintext

[feature/backend-login] 
        β”‚
        β–Ό
     Pull Request
        β”‚
        β–Ό
     [backend]
        β”‚
        β–Ό
     Pull Request
        β”‚
        β–Ό
   [acceptance]
        β”‚
        β–Ό
     Pull Request
        β”‚
        β–Ό
     [main]
Enter fullscreen mode Exit fullscreen mode

βœ… Example Workflow

  1. Create a Feature Branch
git checkout backend
git pull origin backend
git checkout -b feature/backend-login
2. Do your work, commit and push:

Enter fullscreen mode Exit fullscreen mode

git push origin feature/backend-login

  1. Open a Pull Request: From: feature/backend-login

Into: backend

Add reviewers, description, link to related issues.

  1. After Approval: Merge into backend, then repeat this upward:

PR from backend β†’ acceptance

Test/stage in acceptance

PR from acceptance β†’ main once stable

πŸ“Œ Bonus: Directional Naming Diagram
plaintext

[feature/*] ──▢ [backend/frontend] ──▢ [acceptance] ──▢ [main]
                          β–²
                          β”‚
                   [documentation]


Enter fullscreen mode Exit fullscreen mode

πŸ”„ Each arrow is a Pull Request (PR)
βœ… You only push to feature/dev branches, not main directly.

πŸ’‘ Tips
Keep main protected (require PRs + code review)

Label PRs by type: feature, fix, hotfix, docs, etc.

Automate testing in acceptance branch via CI (GitHub Actions, etc.)

Top comments (0)