The site for PHP professionals, Magazine, Training, Books, Conferences
PHP Alive And Kicking: Episode 22 Sara Golemon
Sara Golemon returns to the show — her first appearance was way back in Episode 2 — for a deep dive into Git Worktrees, a powerful but underused Git feature that lets you work on multiple branches simultaneously without the overhead of stashing, context-switching, or rebuilding from scratch. The episode covers practical real-world use cases, a live demo on the PHP source repo, Docker/Lando integration, and some lively chat about AI, scripting, and developer productivity.
Topics Covered
Git Worktrees Main TopicRather than switching between branches and losing build state, Git Worktrees let you check out multiple branches into separate directories — all sharing a single .git history.
- How Worktrees differ from standard
git checkoutbranch switching - Why they shine for projects with build artifacts (compiled code, minified JS) — no recompile on directory switch
- Working with PHP’s multi-version release branches (8.1 → 8.2 → 8.3 → 8.4 → 8.5 → master) simultaneously
- Merging a fix up through all active PHP release branches in a live demo
- Pushing all branches at once from a single shared
.gitdirectory - Cleaning up with
git worktree prune— just deleting the folder isn’t enough!
git worktree add <path> <branch> git worktree list git worktree prune git branch -d <branch> # Only works after pruningWorktrees + Docker / Web Development
The hosts explored how Worktrees fit into a typical PHP web dev workflow with Docker.
- Run multiple Docker Compose environments simultaneously — one per Worktree/branch
- Port clashing is real; solutions include scripted aliases and Lando (handles conflicts automatically)
- Sara’s Git alias
newfrom Facebook/Meta automated Worktree creation and assigned unique IPs per ticket composer installonly needs to run once per Worktree — not on every branch switch
PHP Architect Social Media:
X: https://x.com/phparch
Mastodon: https://phparch.social/@phparch
Bluesky: https://bsky.app/profile/phparch.com
PHPArch.me: https://phparch.me/@phparch
Discord: https://discord.phparch.com
Subscribe to our magazine: https://www.phparch.com/subscribe/
Partner
This podcast is made a little better thanks to our partners
Infrastructure Management, Simplified
Automate Kubernetes deployments across any cloud provider or bare metal with a single command. Deploy, manage, and scale your infrastructure with ease.
https://displace.tech/
Put Your Technical Debt on Autopay with PHPScore
Cut code review time & bugs in half instantly with CodeRabbit.
Music Provided by Epidemic Sound
https://www.epidemicsound.com/
The post PHP Alive And Kicking: Episode 22 Sara Golemon appeared first on PHP Architect.

