Feat #16: Use git worktree instead of git checkout in work-issue workflow#27
Merged
Conversation
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
Closes #16. Replaces the
git checkout -bbranching strategy incommands/work-issue.mdStep 3 withgit worktree add, so each issue gets its own isolated working directory. The user's main checkout is no longer disrupted bygit fetch+git checkoutand multiple issues can be worked on in parallel without stashing.Key changes:
commands/work-issue.mdStep 3 ("Prepare repository" → "Prepare an isolated worktree"): the new flow runsgit worktree add ".worktrees/$BRANCH" -b "$BRANCH" "origin/$DEFAULT_BRANCH"instead ofgit checkout -b, thencds into the worktree for the rest of the workflow..worktrees/is gitignored in the target repo before creating the worktree (auto-adds + commits if missing) so worktree contents never pollutegit status.origin/$DEFAULT_BRANCH, never the user's currentHEAD— this preserves the "always start from latest default" guarantee without needing tocheckoutthe default branch in the user's main worktree.submodule update --init --recursiveruns inside the new worktree (each worktree has its own submodule state).git worktree remove ".worktrees/$BRANCH"once the PR has merged. Force-remove only with explicit user confirmation.claude --worktree <name>flag as an alternative for whole-session isolation.Types of changes
Checklist
linters(0 errors) and a manual read of the new Step 3 / Step 11 against the rest of the workflow.readme.mdincludes sections on introduction, installation, usage, and contributingdocs/architecture.mdincludes sections on the architecture diagram, software units, software of unknown provenance, critical algorithms and risk controls related to PII and security