-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat(server): copy .worktreeinclude files into new worktrees #7956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sriram-52
wants to merge
7
commits into
pingdotgg:main
Choose a base branch
from
Sriram-52:feat/worktreeinclude
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e6be1c0
feat(server): copy .worktreeinclude files into new worktrees
Sriram-52 40bfb08
fix(server): make .worktreeinclude copies collision-safe and truncati…
Sriram-52 d345595
fix(server): keep copying .worktreeinclude entries after one fails
Sriram-52 5a11ddf
fix(server): propagate interrupts through .worktreeinclude copy handlers
Sriram-52 71252d5
fix(server): keep .worktreeinclude copies inside the worktree
Sriram-52 a78d28e
fix(server): check .worktreeinclude containment before creating direc…
Sriram-52 ed8a86b
fix(server): resolve relative worktree paths against the repo cwd
Sriram-52 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copy local files into new worktrees | ||
|
|
||
| When T3 Code starts a thread in a new worktree, Git checks out tracked files only. Untracked | ||
| local files — `.env` files, credentials, machine-specific config — stay behind in the original | ||
| checkout. | ||
|
|
||
| To copy those files into each new worktree automatically, add a `.worktreeinclude` file to the | ||
| repository root. List one pattern per line, using the same syntax as `.gitignore`: | ||
|
|
||
| ``` | ||
| # copied into every new worktree | ||
| .env | ||
| .env.local | ||
| secrets/ | ||
| ``` | ||
|
|
||
| When a worktree is created, every untracked file in the original checkout that matches a pattern | ||
| is copied into the same location in the worktree. Patterns follow `.gitignore` rules: a bare name | ||
| like `.env` matches at any depth, a leading `/` anchors it to the repository root, and a trailing | ||
| `/` matches a whole directory. | ||
|
|
||
| The copy finishes before the project setup script runs, so a setup script can rely on the files | ||
| being there. A file that fails to copy never blocks the worktree: T3 Code logs a warning and the | ||
| thread starts normally. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.