Skip to content

Commit 52dd2ab

Browse files
johannesjoclaude
andcommitted
refactor: move worktrees from .worktrees/ to .git/pc-worktrees/
Stores worktree directories inside .git/ so they are automatically ignored by git, removing the need for a .gitignore entry in user repos. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 91357a4 commit 52dd2ab

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ node_modules
22
dist
33
dist-electron
44
release
5-
.worktrees
65
.idea
76
.claude
87
.DS_Store

electron/ipc/git.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export async function createWorktree(
189189
branchName: string,
190190
symlinkDirs: string[]
191191
): Promise<{ path: string; branch: string }> {
192-
const worktreePath = `${repoRoot}/.worktrees/${branchName}`;
192+
const worktreePath = `${repoRoot}/.git/pc-worktrees/${branchName}`;
193193

194194
// Try -b first (new branch), fall back to existing branch
195195
try {
@@ -217,7 +217,7 @@ export async function removeWorktree(
217217
branchName: string,
218218
deleteBranch: boolean
219219
): Promise<void> {
220-
const worktreePath = `${repoRoot}/.worktrees/${branchName}`;
220+
const worktreePath = `${repoRoot}/.git/pc-worktrees/${branchName}`;
221221

222222
if (!fs.existsSync(repoRoot)) return;
223223

src/components/NewTaskDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export function NewTaskDialog() {
306306
<svg width="11" height="11" viewBox="0 0 16 16" fill="currentColor" style={{ "flex-shrink": "0" }}>
307307
<path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z" />
308308
</svg>
309-
{selectedProjectPath()}/.worktrees/{branchPreview()}
309+
{selectedProjectPath()}/.git/pc-worktrees/{branchPreview()}
310310
</span>
311311
</div>
312312
</Show>

0 commit comments

Comments
 (0)