diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-28 10:38:08 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-28 10:38:08 +0200 |
| commit | ba462ddcef07445294d4e19ca0c5d440d8c51b12 (patch) | |
| tree | fcaaecfb49693f08d19dadc105d754e4dd923c35 /docs/policies/GIT-WORKFLOW.md | |
| parent | da66ef2a6fc569587bd611a9c7f2d78b371f69a7 (diff) | |
| download | danixxyz-ba462ddcef07445294d4e19ca0c5d440d8c51b12.tar.gz danixxyz-ba462ddcef07445294d4e19ca0c5d440d8c51b12.zip | |
docs: update git workflow for production branch strategy
Replace master-as-deploy with three-branch model: feature branches →
master (staging) → production (live). Master no longer triggers deploy.
Updated CLAUDE.md, AGENTS.md, WORKFLOW.md, and all docs/policies files
to reflect production branch approach. Includes deployment commands and
updated FAQ.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/policies/GIT-WORKFLOW.md')
| -rw-r--r-- | docs/policies/GIT-WORKFLOW.md | 179 |
1 files changed, 71 insertions, 108 deletions
diff --git a/docs/policies/GIT-WORKFLOW.md b/docs/policies/GIT-WORKFLOW.md index b421f83..ed07de8 100644 --- a/docs/policies/GIT-WORKFLOW.md +++ b/docs/policies/GIT-WORKFLOW.md @@ -1,68 +1,64 @@ -# Git Workflow Guide — Weekly Branching +# Git Workflow Guide -**Effective Date:** 2026-04-16 -**Policy:** Each week of implementation work starts on a new feature branch for code review and safe integration. +**Effective Date:** 2026-04-28 (production branch added) +**Policy:** Feature branches merge to `master` (staging). `production` branch is the live deploy target. --- ## Overview -### Why Weekly Branching? +### Three Branches -1. **Code Review** — Review all changes for a week before merging to master -2. **Safety** — Easy to rollback if issues are discovered -3. **Isolation** — Each week's work is independent, reducing merge conflicts -4. **History** — Clean git log with logical week-based commits -5. **Testing** — Test entire week's work on feature branch before merging +| Branch | Purpose | +|--------|---------| +| `feature/*`, `week-*` | Development branches. Merge to master when done. | +| `master` | Staging/dev. No deploy hook. Safe for testing and WIP. | +| `production` | Live. Triggers deploy. Only merge from master when ready. | -### Branch Naming Convention +### Workflow ``` -week-<number>-<description> +Feature branch (develop, test) + ↓ + Merge to master (staging, review) + ↓ + Merge to production (LIVE DEPLOY) ``` -Examples: -- `week-3-cards-nav` (Week 3: Cards & Navigation) -- `week-4-forms-interactions` (Week 4: Forms & Interactive Elements) -- `week-5-animations-a11y` (Week 5: Animations & Accessibility) -- `week-6-pages-testing` (Week 6: Missing Pages & End-to-End Testing) +### Branch Naming + +- Feature branches: `feature/*`, `week-*`, `content/*`, `fix/*` +- Examples: `feature/dark-mode`, `week-5-forms`, `content/article-update`, `fix/button-style` --- -## Weekly Workflow +## Feature Branch Workflow -### Step 1: Create Feature Branch +### Step 1: Create Feature Branch (Optional) -At the start of each week, create a new feature branch from `master`: +For significant work, create a feature branch: ```bash # Ensure you're on master and up to date git checkout master -git pull origin master # (if using remote) +git pull origin master # Create feature branch -git checkout -b week-3-cards-nav +git checkout -b feature/my-feature +# or: git checkout -b week-5-forms # Verify branch created git branch -v ``` -Output should show: -``` - master abc1234 commit message -* week-3-cards-nav abc1234 commit message -``` - -The `*` indicates you're on the new branch. +### Step 2: Implement Changes -### Step 2: Implement Week's Work - -While on the feature branch, implement all changes for the week: +While on the feature branch, implement all changes: ```bash -# Make changes to CSS, templates, documentation +# Make changes to CSS, templates, content, docs vim themes/danix-xyz-hacker/assets/css/main.css -vim themes/danix-xyz-hacker/layouts/partials/... +vim content/en/articles/new-article/index.md # Rebuild CSS after changes npm run build @@ -72,7 +68,7 @@ hugo server # Check what changed git status -git diff themes/danix-xyz-hacker/assets/css/main.css +git diff ``` ### Step 3: Commit Regularly @@ -97,81 +93,39 @@ git commit -m "feat: add article card component - Mobile-first responsive design" ``` -### Step 4: Daily Progress Tracking - -Update memory at end of each day during the week: - -```bash -# Create/update memory file -cat > /path/to/.claude/projects/.../memory/week3_progress.md << 'EOF' -# Week 3 Progress - -**Date:** 2026-04-17 -**Status:** In progress (Day 1) - -## Completed Today -- [x] Article card CSS -- [x] Card integration into templates -- [x] Responsive testing - -## Tomorrow -- [ ] Navigation header -- [ ] Hamburger menu -EOF - -git add memory/week3_progress.md -git commit -m "docs: update week 3 progress (day 1)" -``` - -### Step 5: Review Changes at End of Week +### Step 4: Review Changes Before Merge -Before merging back to master, review all changes: +Before merging to master, review all changes: ```bash -# Show all commits in this week -git log master..week-3-cards-nav --oneline +# Show all commits in this branch +git log master..feature/my-feature --oneline # Show all file changes (diff summary) -git diff --stat master..week-3-cards-nav +git diff --stat master..feature/my-feature -# Show detailed diff for CSS -git diff master..week-3-cards-nav themes/danix-xyz-hacker/assets/css/main.css +# Show detailed diff for critical files +git diff master..feature/my-feature -# Show detailed diff for specific template -git diff master..week-3-cards-nav themes/danix-xyz-hacker/layouts/partials/ -``` - -Example output: -``` -abc1234 feat: add article card component -def5678 feat: add navigation header -ghi9012 feat: add hamburger menu -jkl3456 feat: add breadcrumb navigation -mno7890 docs: update week 3 completion report - - themes/danix-xyz-hacker/assets/css/main.css | +180 -0 - themes/danix-xyz-hacker/layouts/partials/card.html | +45 -0 - themes/danix-xyz-hacker/layouts/partials/nav.html | +32 -0 - WEEK3-IMPLEMENTATION.md | +200 -0 - 3 files changed, 457 insertions(+) +# Check git log looks good +git log --oneline -10 ``` -### Step 6: Test Thoroughly +### Step 5: Test Thoroughly Before Merge -Before merging, test everything on the feature branch: +Test everything on the feature branch: ```bash # Start dev server hugo server # Test in browser: -# - Dark mode (several pages) -# - Light mode (toggle, verify all components) -# - Mobile (320px) -# - Tablet (768px) -# - Desktop (1060px+) -# - Keyboard navigation (Tab, Enter, Escape) -# - All new components interactive +# - Dark mode +# - Light mode +# - Mobile (320px), tablet (768px), desktop (1060px+) +# - Keyboard navigation (Tab, Shift+Tab, Escape) +# - All interactive elements +# - Responsive layouts # Run CSS build without errors npm run build @@ -208,37 +162,46 @@ git add WEEK3-IMPLEMENTATION.md memory/week3_complete.md git commit -m "docs: week 3 implementation complete" ``` -### Step 8: Merge Back to Master +### Step 6: Merge to Master -Once testing is complete and you're satisfied with all changes: +Once testing is complete: ```bash # Switch to master git checkout master +git pull origin master -# Merge feature branch (creates merge commit) -git merge week-3-cards-nav - -# Or merge with --squash if you want single commit per week -# git merge --squash week-3-cards-nav -# git commit -m "feat: week 3 - card layouts and navigation components" +# Merge feature branch +git merge feature/my-feature -# Delete the feature branch (optional, good practice) -git branch -d week-3-cards-nav +# Optional: Delete the feature branch +git branch -d feature/my-feature # Verify merge git log --oneline -10 + +# Push to staging (no deploy yet) +git push origin master ``` -After merge, master will have all Week 3 changes. +### Step 7: Deploy to Production -### Step 9: Prepare for Next Week +When master is ready for the live site: ```bash -# Create Week 4 branch from updated master -git checkout -b week-4-forms-interactions +# Switch to production +git checkout production +git pull origin production + +# Merge master into production +git merge master + +# This triggers the post-receive hook and live deploy +git push origin production -# Continue with Week 4 work... +# Verify deployment +# - Check server logs +# - Test the live site ``` --- |
