Skip to content

New skill: Git branching strategy for staging/prod deployments #20

Description

@firstloop-jake

Skill

monotemplate:branching-strategy (new skill)

Problem

We encountered merge conflicts when promoting main to prod because the previous promote-to-prod PR was squash merged instead of using a fast-forward/rebase merge. This caused git to not recognize that the commits on main were already included in the squashed commit on prod.

There's no documented guidance on how to manage staging and production branch workflows.

Proposed Solution

Create a new skill that documents:

Key Concepts

  • Why squash merging breaks the mainprod workflow
  • How git SHAs work and why identical changes with different SHAs cause conflicts
  • The difference between merge, squash, rebase, and fast-forward

Branch Protection Setup

  • How to configure GitHub branch protection for prod
  • Required linear history setting
  • Recommended protections (no force push, no deletions)

Workflows

  • Promote to production workflow (always use rebase/fast-forward)
  • Recovering from accidental squash merge (force push reset)
  • Setting up branch protection via gh CLI

Examples

The problem:

main:  A -> B -> C -> D -> E
prod:  A -> [squashed B+C+D] -> ??? (conflicts when merging E)

The solution:

main:  A -> B -> C -> D -> E
prod:  A -> B -> C -> D -> E  (fast-forward, same commits)

Trigger Phrases

  • "promote to prod"
  • "deploy to production"
  • "merge conflicts on prod"
  • "branching strategy"
  • "branch protection"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions