From 0c2990815841be190f38bef2cedb5ce70b82a8a2 Mon Sep 17 00:00:00 2001 From: Andy <119136210+AndyMik90@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:50:05 +0100 Subject: [PATCH] auto-claude: subtask-1-1 - Add --no-track flag to git worktree add command (#1455) Prevents new worktree branches from inheriting upstream tracking from the base ref (e.g., origin/main). This ensures users can push with -u to correctly set up tracking to their own remote branch instead of incorrectly tracking the base branch. Co-authored-by: Claude Opus 4.5 --- .../src/main/ipc-handlers/terminal/worktree-handlers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/main/ipc-handlers/terminal/worktree-handlers.ts b/apps/frontend/src/main/ipc-handlers/terminal/worktree-handlers.ts index 236f7e00..ac450d34 100644 --- a/apps/frontend/src/main/ipc-handlers/terminal/worktree-handlers.ts +++ b/apps/frontend/src/main/ipc-handlers/terminal/worktree-handlers.ts @@ -434,7 +434,10 @@ async function createTerminalWorktree( } if (createGitBranch) { - execFileSync(getToolPath('git'), ['worktree', 'add', '-b', branchName, worktreePath, baseRef], { + // Use --no-track to prevent the new branch from inheriting upstream tracking + // from the base ref (e.g., origin/main). This ensures users can push with -u + // to correctly set up tracking to their own remote branch. + execFileSync(getToolPath('git'), ['worktree', 'add', '-b', branchName, '--no-track', worktreePath, baseRef], { cwd: projectPath, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'],