Worktree Workflow with Development Branch Sync
Core Principle
Main project directories ALWAYS stay on development branch.
Project Directories (Always on Development)
OpenAPI & Design
/Users/flux423/Sites/LLM/technical-guide
Core Services
/Users/flux423/Sites/LLM/agent-buildkit/Users/flux423/Sites/LLM/gitlab_components
Drupal Site
/Users/flux423/Sites/LLM/llm-platform
Drupal Custom Code
/Users/flux423/Sites/LLM/all_drupal_custom/recipes/llm_platform/Users/flux423/Sites/LLM/all_drupal_custom/recipes/secure_drupal/Users/flux423/Sites/LLM/all_drupal_custom/themes/llm_platform_manager/Users/flux423/Sites/LLM/all_drupal_custom/modules/*
NPM Packages
/Users/flux423/Sites/LLM/common_npm/studio-ui/Users/flux423/Sites/LLM/common_npm/agent-*/Users/flux423/Sites/LLM/common_npm/*
Models
/Users/flux423/Sites/LLM/models/*
Workflow Steps
1. Create Issue in GitLab
Create issue describing the work.
2. Create MR from Issue
Click "Create merge request" in GitLab UI.
3. Fetch and Create Worktree
cd /path/to/main/project
git fetch origin
git worktree add ../worktrees/<branch-name> <branch-name>
cd ../worktrees/<branch-name>
4. Work in Worktree
Make changes, commit, push to MR branch.
5. After MR Merges
# Remove worktree
git worktree remove ../worktrees/<branch-name>
# Return to main project directory
cd /path/to/main/project
# Pull latest development changes
git pull origin development
Quick Commands
Setup Worktree
git fetch origin && \
git worktree add ../worktrees/<branch> <branch> && \
cd ../worktrees/<branch>
Cleanup After Merge
cd /path/to/main/project && \
git worktree remove ../worktrees/<branch> && \
git pull origin development
Verification
Always verify main directory is on development:
cd /path/to/main/project
git branch --show-current # Should show: development