docs(dev-practices): add multi-session-worktrees-guide.md#41
Closed
rafael5 wants to merge 1 commit into
Closed
Conversation
The strategic doc (parallel-multi-repo-git-hygiene.md) names Rule 2 "worktrees for parallel branches in the same repo" but only shows the one-line setup command. This guide is the operational companion: layout convention (sibling-of-main-checkout, <repo>-<branch-slug> naming), three setup variants, daily usage, cleanup + pruning, six gotchas (direnv, .venv, pytest cache, branch-already-checked-out, CI-doesn't-care, don't-run-sessions-in-main-checkout), and a bootstrap script for adopting the convention across the existing org. Also: - Rule 2 of parallel-multi-repo-git-hygiene.md now points at this guide for the full mechanics. - dev-practices/README.md index now lists both docs. Authored after a multi-session collision in this very session surfaced the need (see docs-discoverability phases-tracker §7 2026-05-11 entry). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Closing — worktrees are an escape hatch, not the default. Adopting the simpler 'one session per repo' rule (Rule 1 of parallel-multi-repo-git-hygiene.md) as the front-and-center practice instead. Worktrees stay documented as a one-line option inside the strategic doc for the rare case they're needed. The cognitive overhead of layout convention + setup commands + cleanup + gotchas isn't worth it when the simpler rule covers the same problem. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to
parallel-multi-repo-git-hygiene.mdRule 2. Where the strategic doc names the rule, this guide is the operational manual:<repo>-<branch-slug>naminggit fetchpatterngit worktree prune.venv/, pytest cache pinning, branch-already-checked-out errors, CI orthogonality, "don't run sessions in the main checkout"Also wires Rule 2 of the strategic doc and the
dev-practices/README.mdindex to point at this guide.The session that authored this PR itself fell into the multi-session trap mid-flight (commit briefly landed on
mainbecause another session rangit checkout mainin the same working tree betweencheckout -bandcommit) — exactly the failure mode this guide is meant to prevent.Test plan
make check-docs-prosepassesparallel-multi-repo-git-hygiene.md§Rule 2 anddev-practices/README.mdindex resolve🤖 Generated with Claude Code