Files
ai-workflow-course/modules/07-worktrees-running-agents-in-parallel/lab/setup-worktrees.sh
T
claude 2684095e2f Build out all 27 modules + capstone (#1)
Co-authored-by: claude <claude@jpaul.io>
Co-committed-by: claude <claude@jpaul.io>
2026-06-22 12:19:01 -04:00

26 lines
972 B
Bash

#!/usr/bin/env bash
#
# Module 7 lab — create two linked worktrees off the tasks-app repo, each on its own branch.
# Run this from INSIDE your tasks-app repo (the one you git-init'd in Module 2):
#
# bash modules/07-worktrees-running-agents-in-parallel/lab/setup-worktrees.sh
#
# It places the new worktree folders next to the repo, so you end up with:
#
# <parent>/tasks-app (your existing repo, on its current branch)
# <parent>/tasks-app-clear (new worktree on branch feature/clear)
# <parent>/tasks-app-count (new worktree on branch feature/count)
#
set -euo pipefail
# The directory that contains the repo, so the new worktrees become siblings of it.
ROOT="$(git rev-parse --show-toplevel)"
PARENT="$(cd "$ROOT/.." && pwd)"
git worktree add "$PARENT/tasks-app-clear" -b feature/clear
git worktree add "$PARENT/tasks-app-count" -b feature/count
echo
echo "Worktrees created. One repo, three checked-out branches:"
git worktree list