commit-main
Commit current changes to main, merge into beta, and rebase any feature branch.
Workflow
- •Record the current branch and determine the situation:
- •Uncommitted changes: stash if on a feature branch, switch to
main, pop stash, stage, and commit. - •Most recent commit already on current branch: switch to
mainand cherry-pick it.
- •Uncommitted changes: stash if on a feature branch, switch to
- •Switch to
mainand pull latest (git pull). - •Get changes onto
mainper the situation above. - •Commit (if uncommitted path) — follow the project's normal commit process. Pre-commit hooks run Ruff and pycheck; retry once if auto-fixes are applied.
- •Switch to
betaand pull latest (git pull). - •Merge
mainintobeta(git merge main). If conflicts arise, ask the user. - •If the original branch was a feature branch:
a. Switch back to the feature branch.
b. Rebase onto
beta(git rebase beta). If conflicts arise, ask the user. - •End on the original branch.
Important notes
- •Always
git pullbefore committing tomainand before merging intobetato avoid conflicts. - •Never force-push. If a push is needed, confirm with the user first.
- •If pre-commit hooks fail, check if Ruff auto-fixed issues and retry the commit once.
- •Do not push any branches unless the user explicitly asks.
- •If merge or rebase conflicts arise, stop and ask the user how to resolve them.