Athena — mahmoud-consultancy/archive/old-docs/WORKTREE_SETUP_COMPLETE.md

Git Worktrees - Setup Compleet ✅

Datum: 17 Oktober 2025 Status: Worktrees actief en klaar voor parallel werken


✅ Huidige Setup

Je hebt nu 3 worktrees actief:

/Users/sarkout/projects/prive/
├── mahmoud-consultancy/              [rename-to-glorylabs] ← MAIN REPO
├── mahmoud-consultancy-glorylabs/    [feature/glorylabs-website] ← GloryLabs work
└── mahmoud-consultancy-cvbuilder/    [feature/cv-builder] ← CV Builder session

Main Repository:

  • Path: /Users/sarkout/projects/prive/mahmoud-consultancy
  • Branch: rename-to-glorylabs
  • Purpose: General work, merging, documentation
  • Status: Clean (CV builder files moved to worktree)

Worktree 1: GloryLabs Website

  • Path: /Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs
  • Branch: feature/glorylabs-website
  • Purpose: GloryLabs website development & deployment
  • Files: website/glorylabs/*, all GloryLabs docs
  • Status: Ready for deployment work

Worktree 2: CV Builder (Other Session)

  • Path: /Users/sarkout/projects/prive/mahmoud-consultancy-cvbuilder
  • Branch: feature/cv-builder
  • Purpose: CV Builder feature development
  • Files: frontend/recruitment-portal/src/app/components/cv-builder/*
  • Status: Active (other session working here)

🚀 Hoe Te Gebruiken

Voor GloryLabs Website Werk:

# Ga naar GloryLabs worktree
cd /Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs

# Check status
git status
git branch  # Should show: feature/glorylabs-website

# Work on website
cd website/glorylabs
# Edit files, test deployment, etc.

# Commit work
git add website/glorylabs/
git commit -m "feat: deploy GloryLabs website"
git push origin feature/glorylabs-website

# Create PR (optional)
gh pr create --base rename-to-glorylabs \
    --head feature/glorylabs-website \
    --title "feat: GloryLabs website deployment"

Voor CV Builder Werk (Andere Sessie):

# Andere sessie werkt hier:
cd /Users/sarkout/projects/prive/mahmoud-consultancy-cvbuilder

# Check status
git status
git branch  # Should show: feature/cv-builder

# Work on CV builder
cd frontend/recruitment-portal/src/app/components/cv-builder
# Edit, test, commit

# The other session can commit here without affecting GloryLabs work!

Voor Algemeen Werk (Main Repo):

# Blijf in main repo
cd /Users/sarkout/projects/prive/mahmoud-consultancy

# Voor kleine fixes, documentation, etc.
# Bijvoorbeeld: update README, fix typos, etc.

🎯 Workflow Per Sessie

Jouw Sessie (GloryLabs):

  1. cd ../mahmoud-consultancy-glorylabs
  2. Work on GloryLabs website
  3. Test deployment: cd website/glorylabs && ./deploy.sh
  4. Commit: git add website/ && git commit -m "feat: ..."
  5. Push: git push origin feature/glorylabs-website

Andere Sessie (CV Builder):

  1. cd ../mahmoud-consultancy-cvbuilder
  2. Work on CV Builder feature
  3. Test: cd frontend/recruitment-portal && npm start
  4. Commit: git add frontend/ && git commit -m "feat: ..."
  5. Push: git push origin feature/cv-builder

Beide kunnen TEGELIJK werken zonder conflicts!


🔄 Merging Strategy

Wanneer een feature klaar is:

Option 1: Direct Merge (Simple)

cd /Users/sarkout/projects/prive/mahmoud-consultancy

# Update main branch first
git pull origin rename-to-glorylabs

# Merge GloryLabs work
git merge feature/glorylabs-website

# Merge CV Builder work
git merge feature/cv-builder

# Push combined work
git push origin rename-to-glorylabs

Option 2: Pull Requests (Recommended for Review)

# From GloryLabs worktree
cd ../mahmoud-consultancy-glorylabs
git push origin feature/glorylabs-website
gh pr create --base rename-to-glorylabs --head feature/glorylabs-website

# From CV Builder worktree
cd ../mahmoud-consultancy-cvbuilder
git push origin feature/cv-builder
gh pr create --base rename-to-glorylabs --head feature/cv-builder

# Review and merge PRs on GitHub
# Then pull updates in main repo

📂 File Separation

GloryLabs Worktree Bevat:

website/glorylabs/
├── index.html
├── diensten.html
├── producten.html
├── nginx.conf
├── deploy.sh
└── ...

GLORYLABS_*.md (alle documentatie)
WORKTREE_*.md (worktree docs)

CV Builder Worktree Bevat:

frontend/recruitment-portal/src/app/
├── components/cv-builder/
│   ├── cv-builder.html
│   ├── cv-builder.ts
│   ├── cv-builder.scss
│   ├── shared/
│   └── steps/
└── services/
    └── cv-builder.ts

frontend/recruitment-portal/src/app/models/
└── cv-builder.model.ts

Main Repo Bevat:

Alle files, maar zonder:
- Untracked CV builder files (moved to cv-builder worktree)
- Beide worktrees kunnen hun eigen changes maken

🎨 VS Code Setup

Open elk worktree in apart VS Code window:

# Window 1: GloryLabs
code /Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs

# Window 2: CV Builder (andere sessie)
code /Users/sarkout/projects/prive/mahmoud-consultancy-cvbuilder

# Window 3: Main repo (algemeen)
code /Users/sarkout/projects/prive/mahmoud-consultancy

Elk window heeft:

  • ✅ Eigen terminal
  • ✅ Eigen git branch
  • ✅ Eigen file watcher
  • ✅ Geen conflicts!

🔍 Verificatie

Check Worktrees:

cd /Users/sarkout/projects/prive/mahmoud-consultancy
git worktree list

Expected output:

/Users/sarkout/projects/prive/mahmoud-consultancy            051c6d3 [rename-to-glorylabs]
/Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs  1135a65 [feature/glorylabs-website]
/Users/sarkout/projects/prive/mahmoud-consultancy-cvbuilder  051c6d3 [feature/cv-builder]

Test GloryLabs Worktree:

cd /Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs
git branch  # Should show: feature/glorylabs-website
ls website/glorylabs/  # Should show all website files

Test CV Builder Worktree:

cd /Users/sarkout/projects/prive/mahmoud-consultancy-cvbuilder
git branch  # Should show: feature/cv-builder
ls frontend/recruitment-portal/src/app/components/cv-builder/  # Should show CV builder files

💡 Practical Examples

Example 1: Deploy GloryLabs While Other Session Runs

# Terminal 1: Your work (GloryLabs)
cd /Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs
cd website/glorylabs
python3 -m http.server 8080  # Test
./deploy.sh  # Deploy when ready

# Terminal 2: Other session (CV Builder) - kan ondertussen draaien!
cd /Users/sarkout/projects/prive/mahmoud-consultancy-cvbuilder
npm start  # Or whatever the other session is doing

Example 2: Fix Issue in Main Repo

# Quick fix in main repo (doesn't affect worktrees)
cd /Users/sarkout/projects/prive/mahmoud-consultancy
# Fix something
git add .
git commit -m "fix: quick bugfix"
git push

Example 3: Test Both Features Side by Side

# Terminal 1: GloryLabs website
cd ../mahmoud-consultancy-glorylabs/website/glorylabs
python3 -m http.server 8080

# Terminal 2: InterimPlaza platform (CV builder)
cd ../mahmoud-consultancy-cvbuilder/frontend/recruitment-portal
npm start  # Runs on different port (4200)

# Both running simultaneously for testing!

🧹 Cleanup (Na Merge)

Wanneer je klaar bent met een worktree:

# Option 1: Use cleanup script
./cleanup-worktrees.sh

# Option 2: Manual cleanup
git worktree remove /Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs
git branch -d feature/glorylabs-website
git worktree prune

⚠️ Belangrijke Opmerkingen

DO:

  • ✅ Commit regelmatig in elk worktree
  • ✅ Push naar origin (backup je werk)
  • ✅ Gebruik aparte terminals/VS Code windows per worktree
  • ✅ Check git worktree list om te zien waar je bent

DON'T:

  • ❌ Probeer dezelfde branch in meerdere worktrees te checken
  • ❌ Delete worktree directories handmatig (use git worktree remove)
  • ❌ Forget waar je bent (check pwd en git branch)
  • ❌ Leave uncommitted work (commit of stash)

🚨 Als Je Vast Loopt

"Branch is already checked out"

git worktree list  # See where it is
# Can't check out same branch twice - by design!

"Which worktree am I in?"

pwd  # Shows directory path
git branch  # Shows current branch
git worktree list  # Shows all worktrees

"How do I get back to main repo?"

cd /Users/sarkout/projects/prive/mahmoud-consultancy

"Worktree has uncommitted changes"

cd <worktree-path>
git status
git add .
git commit -m "wip: save work"

📊 Current Project State

Files Modified/Created Today:

GloryLabs Website (in glorylabs worktree):

  • ✅ website/glorylabs/index.html (42KB) - 5 diensten, 3 producten
  • ✅ website/glorylabs/diensten.html (27KB) - AI toegevoegd
  • ✅ website/glorylabs/producten.html (27KB) - TheRoomy, Claimio
  • ✅ Compliance sectie (NIS2, AVG)
  • ✅ Security audit & deployment scripts

CV Builder (in cvbuilder worktree, andere sessie):

  • ✅ frontend/.../cv-builder/ component
  • ✅ cv-builder.ts service
  • ✅ cv-builder.model.ts
  • ✅ Planning docs

Main Repo:

  • ✅ Worktree setup scripts
  • ✅ Documentation
  • ✅ Clean working directory

🎯 Aanbevolen Next Steps

Voor Jou (GloryLabs):

cd /Users/sarkout/projects/prive/mahmoud-consultancy-glorylabs
# Work on GloryLabs deployment
# Commit and push when done

Voor Andere Sessie (CV Builder):

cd /Users/sarkout/projects/prive/mahmoud-consultancy-cvbuilder
# Continue CV Builder development
# Completely separate from your work!

Wanneer Beide Klaar Zijn:

cd /Users/sarkout/projects/prive/mahmoud-consultancy
git merge feature/glorylabs-website
git merge feature/cv-builder
git push origin rename-to-glorylabs

📚 Documentatie Files

  • WORKTREE_STRATEGY.md - Complete strategie, workflows, best practices
  • WORKTREE_QUICKSTART.md - Snelle 2-minuten guide
  • WORKTREE_SETUP_COMPLETE.md - Dit document
  • setup-worktrees.sh - Automated setup script
  • cleanup-worktrees.sh - Cleanup script

✅ Verification Checklist

  • [x] Main repo is clean (geen untracked files die problemen geven)
  • [x] GloryLabs worktree heeft alle website files
  • [x] CV Builder worktree heeft alle CV builder files
  • [x] Beide worktrees hebben eigen branches
  • [x] Worktrees kunnen parallel werken
  • [x] Scripts zijn executable en klaar
  • [x] Documentatie is compleet

🎉 Ready!

Je kunt nu aan meerdere features tegelijk werken zonder elkaar in de weg te zitten!

Quick Commands:

# Check huidige worktrees
git worktree list

# Ga naar GloryLabs worktree
cd ../mahmoud-consultancy-glorylabs

# Ga naar CV Builder worktree (andere sessie)
cd ../mahmoud-consultancy-cvbuilder

# Terug naar main
cd /Users/sarkout/projects/prive/mahmoud-consultancy

Have fun met parallel development! 🚀


Pro Tip: Open elk worktree in een apart terminal window of VS Code window voor maximale efficiency!

Reacties

Nog geen reacties