Git Branch PR decision - globe-and-citizen/cnc-portal GitHub Wiki

โœ… Should this change be in a separate branch and PR?

Ask yourself the following questions:

  1. Is this change unrelated to the current work in the branch? โ†’ โœ… Yes โ†’ Put it in a separate branch and PR โ†’ โŒ No โ†’ Go to next question

  2. Is the change tightly coupled with the current work? โ†’ โœ… Yes โ†’ Go to next question โ†’ โŒ No โ†’ Put it in a separate branch and PR

  3. Is this change likely to be needed by other teammates soon (e.g., shared component, helper, refactor)? โ†’ โœ… Yes โ†’ Put it in a separate branch and PR, and prioritize its delivery โ†’ โŒ No โ†’ You can include it in the current PR, but clearly explain the dependency


โšก Quick Rules of Thumb

  • ๐Ÿ”ง Bug fix that's unrelated โ†’ Separate PR
  • ๐ŸŒฑ New feature โ†’ Always a separate PR
  • ๐Ÿงน General-purpose refactor โ†’ Separate PR
  • โ™ป๏ธ Refactor required for the feature โ†’ Can be in same PR
  • ๐ŸŽฏ Change is useful to others immediately โ†’ Separate PR, deliver it first
  • ๐Ÿช„ Small polish tied to main feature โ†’ Same PR

๐Ÿ“Œ Why this matters

  • โœ… Keeps PRs focused, smaller, easier to review
  • ๐Ÿงช Enables independent testing and CI feedback
  • ๐Ÿ” Allows other team members to reuse work sooner
  • ๐Ÿงผ Maintains a clean and understandable Git history
  • ๐Ÿš€ Makes releases and hotfixes safer and faster