Date: 2024-05-20 • Status: Accepted
Context: Development Team, DevOps
Our current "GitFlow" strategy is causing:
We are adopting a Rebase-then-Merge policy.
✅ Primary Branch: main (Single source of truth)
✅ Feature Branches: Short-lived (2-3 days max)
✅ Conflicts: Resolved daily via rebase
✅ Merging: --no-ff to keep history bubbles
Features must start from the latest stable code.
# 1. Update local main
git checkout main
git pull origin main
# 2. Create feature branch
git checkout -b JNET-123-ticket-branch
Prevent "Branch Hell" by syncing daily.
git fetch origin main
# Replay your work on top of latest main
git rebase origin/main
# Update remote (Lease protects overwrites)
git push origin --force-with-lease
The merge creates a visual "bubble" in the history.
# Create PR via CLI
gh pr create --base main \
--head JNET-123-ticket-branch \
--title "🚀 Release $(date +%F)"
# Merge preserving history bubble
gh pr merge --merge
We decouple Merge from Release.
Phase A: Auto-Staging
Merge to Main → Auto-Deploy to Staging
Phase B: "Create Release"
Do not wait for the next full release.
# 1. Target the release branch
git checkout release/v1.2.0
# 2. Apply fix & push (Triggers Prod Deploy)
git commit -m "FIX: Critical bug JNET-999"
git push origin release/v1.2.0
Ensure the fix doesn't disappear in v1.3.0.
git checkout main
# Cherry-pick the fix hash
git cherry-pick
git push origin main