Multi-Repo Workflows
When a feature spans multiple services or packages, you need a way to keep related branches in sync. Workset threads solve this by treating a set of repos as a single unit of work.
The Problem
Section titled “The Problem”Without Workset, multi-repo work looks like this:
- Create
feature-authbranch inapirepo - Create
feature-authbranch infrontendrepo - Create
feature-authbranch inplatformrepo - Remember which branch goes with which repo
- Hope you don’t accidentally push to
main
With Workset, all three repos live under one thread directory, each as a linked worktree. One command shows you the status of all of them.
Basic Pattern
Section titled “Basic Pattern”# Create a thread for the featureworkset new feature-auth
# Add all relevant reposworkset repo add git@github.com:org/api.git -t feature-authworkset repo add git@github.com:org/frontend.git -t feature-authworkset repo add git@github.com:org/platform.git -t feature-auth
# Check status across all reposworkset status -t feature-authWorking in the Thread
Section titled “Working in the Thread”Each repo in the thread is a linked worktree. You can:
cdinto any repo and work normally- Branches are isolated —
mainin your main clone is untouched git push,git pull, and all normal operations work as expected
Checking Status
Section titled “Checking Status”workset status -t feature-authThis shows the current branch, status, and any local changes across all repos in the thread.
Removing a Repo
Section titled “Removing a Repo”workset repo rm api -t feature-authThis removes the worktree for that repo from the thread. The main clone is unaffected.
Cleaning Up
Section titled “Cleaning Up”When the feature is merged:
workset rm -t feature-auth --deleteThis removes the thread directory and all worktrees. Safety checks prevent deletion of unmerged branches.
- Set
defaults.threadto skip-ton every command. - Use worksets if you frequently work with the same group of repos.
- The Desktop App provides a GUI for managing threads.