docs(advanced-git): main worktree is reference only — work in fresh worktrees - #131
Merged
Conversation
…orktrees In the bare-worktree layout, main/ is for reading, fetching, and as the base for new worktrees. Every task gets its own fresh worktree cut from a freshly fetched origin/main (origin/* does not auto-update in this layout), removed together with its local branch after merge. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Clarifies the intended “bare + per-branch worktrees” discipline by explicitly stating that main/ is a read-only reference worktree and that all development should happen in fresh, task-specific worktrees branched from a freshly fetched origin/main.
Changes:
- Document that
main/is reference-only (no edits/commits) and that new work should be done in fresh worktrees. - Add example commands for fetching and creating a new worktree from
origin/main. - Add post-merge cleanup guidance (worktree + local branch removal).
Suppressed comments (1)
skills/git-workflow/references/advanced-git.md:419
- “Remove the worktree and the local branch” is easy to misread as
worktree removealso deleting the branch, but it doesn’t. Adding explicit commands here would make the cleanup step unambiguous.
Remove the worktree and the local branch once the PR merges.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Local main is only current after an explicit fast-forward; the preferred examples now match the fresh-worktree guidance above. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
|
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.



Makes the worktree discipline explicit in the bare-worktree layout section of
references/advanced-git.md:main/is reference only: reading code,git fetch, base for new worktrees — no commits or edits thereorigin/main(origin/*does not auto-update in the bare layout)worktree addexamples in the section now useorigin/mainas start point (localmainis only current after an explicit fast-forward)The section already showed the layout and commands but never stated that working directly in
main/is out.