Repository navigation
Git Workflow
Chris edited this page Oct 4, 2026
·
2 revisions
Nobody pushes to main directly. Every change goes on a branch and through a pull request, which the owner reviews
and merges.
Merging is not deploying. A merge into main reaches the Staging site. Production only changes when
the owner publishes a release (Deployment).
git checkout main
git pull origin main
git checkout -b 154-upload-feedback # <issue number>-<short description>Work against http://localhost:8000 (Getting Started) and run the tests (Testing). Commit in steps that make sense on their own. Write messages that say what changed and why:
Streak: a day only counts once that day's goal is reached (#423)
Players kept a streak by answering one beetle a day...
- New Python or JS dependencies need
docker compose buildorpixi run install-js; see Getting Started. - New model fields need a migration; see Migrations below.
- Template changes with new Tailwind classes need
pixi run build-css. Commit the rebuiltstyle.css.
git push -u origin 154-upload-feedbackOpen the PR into main. In the description:
- What it does, in a few bullets;
-
Why, with
Closes #154; - How you tested it: which tests you added, and what you clicked through, with a screenshot for anything visible;
-
Anything the owner must do after deploying: a new setting in
.env.prod, or a one-off command.
CI must be green before review.
- Keep it small: one topic per PR. If a task has parts, split it into several PRs.
-
Stacking: if PR B needs PR A, branch B off A and set B's base to A's branch. Say so in both descriptions
("merge #440 first"). GitHub retargets B to
mainwhen A is merged and its branch is deleted. -
Catching up with
main: mergemaininto your branch (git fetch origin && git merge origin/main). Don't rebase or force-push a branch someone else may have checked out. -
Conflicts in generated files: resolve conflicts in
pixi.lockorpackage-lock.jsonby re-running the tool (pixi install,npm install), not by hand. Forstyle.css, runpixi run build-cssafter the merge.
Production runs migrate on every deploy, against live data, while the previous version is still serving. So:
- Only add: new tables, new nullable columns, or columns with defaults. Old code must keep working on the new schema.
-
Removing data takes two releases: first stop using the column, then remove it in a later PR, with
DESTRUCTIVE_OK = "why it is safe"on the migration. -
Data migrations (
RunPython): setDATA_MIGRATION_REVIEWED = "what it reads and writes", and make them safe to run twice. -
Numbering clashes: if two open PRs both add migration
00NN, the second one to merge renumbers its migration and pointsdependenciesat the first one's. Runpython manage.py makemigrations --checkafterwards; it should say "No changes detected".
test_deploy_safety.py enforces these rules (Testing).