From f5036b8b56a7d86d42844a26eb9704376cedb27f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 28 Dec 2025 15:50:57 -0600 Subject: [PATCH] Checkout branch name, not commit oid --- src/lib/ProjectsManager.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/ProjectsManager.ts b/src/lib/ProjectsManager.ts index f2e9c68d..cd202e1f 100644 --- a/src/lib/ProjectsManager.ts +++ b/src/lib/ProjectsManager.ts @@ -146,13 +146,12 @@ export class ProjectsManager { force: true, }); - // Directly checkout the remote commit to update working directory - // This bypasses merge entirely and just makes the working directory - // match the remote commit exactly. Safe for templates. + // Checkout the branch (not the commit SHA) to update working directory + // This keeps the repository on the branch instead of entering detached HEAD state // Using force: true to overwrite any local changes await this.git.checkout({ dir: templatePath, - ref: remoteOid, + ref: branchName, force: true, }); }