← Documentation Home

Worktree Workflow with Development Branch Sync

Core Principle

Main project directories ALWAYS stay on development branch.

Project Directories (Always on Development)

OpenAPI & Design

Core Services

Drupal Site

Drupal Custom Code

NPM Packages

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