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)