Pushes the current work on main to production by updating the prod branch—commit and push main, then applies every commit that exists on main but not on prod onto prod as one squashed commit and pushes prod (triggers GitHub Pages). Use when the user asks to deploy to prod, ship to production, release main to the live site, or run this repo’s prod deploy workflow.
main to production (prod)Production is the prod branch. Pushing prod to origin runs .github/workflows/deploy.yml and deploys to GitHub Pages.
main is the integration branch; prod tracks what is live.main before pushing (or explicitly include WIP in the commit the user wants).maingit status — confirm what will ship.git push origin main.prod with main (squashed cherry-pick)Goal: one new commit on prod that contains all changes reachable from main but not from prod, without preserving per-commit history on prod.
git fetch origin
git checkout prod
git pull origin prod
Apply all main-only commits as one commit (no per-commit cherry-pick noise on prod):
Git Bash / sh (recommended on Windows):
commits=$(git rev-list --reverse prod..main)
if [ -z "$commits" ]; then
echo "prod already includes main; nothing to cherry-pick."
else
git cherry-pick -n $commits
git commit -m "Deploy: sync main to prod ($(date -u +%Y-%m-%d))"
fi
git cherry-pick -n applies the patch series without committing after each step; the final git commit is the squash.
git push origin prod
prod on GitHub Actions (Pages deploy).prod..main was empty in step 2, do not create an empty commit; prod is already aligned with main for deployed content.If git cherry-pick -n stops with conflicts:
git add resolved paths.git cherry-pick --continue if Git still considers the cherry-pick in progress; otherwise complete the single commit manually.git push origin prod when the branch is consistent.If a linear history allows it and the user accepts merge semantics:
prod: git merge --squash main then one commit and git push origin prod.Prefer the cherry-pick -n path when matching the team’s “cherry-pick then squash” wording.
main directly for this project—Pages listens to prod per workflow.main’s history when only prod should get a single deploy commit (keep main’s normal commit history unless the user asks otherwise).