Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix: detect per-user Git for Windows installation (#1261)

worktrunk-botc3a4d9c140cb
diff --git a/src/shell_exec.rs b/src/shell_exec.rs
index d3471d716..d98d13318 100644
--- a/src/shell_exec.rs
+++ b/src/shell_exec.rs
@@ -166,13 +166,25 @@ fn find_git_bash() -> Option<PathBuf> {
}
}
- // Fallback: standard Git for Windows path (needed on some CI environments
+ // Fallback: standard Git for Windows paths (needed on some CI environments
// where `which` doesn't find git even though it's installed)
let bash_path = PathBuf::from(r"C:\Program Files\Git\bin\bash.exe");
if bash_path.exists() {
return Some(bash_path);
}
+ // Per-user Git for Windows installation (default path when installed without admin rights)
+ if let Ok(local_app_data) = std::env::var("LOCALAPPDATA") {
+ let bash_path = PathBuf::from(local_app_data)
+ .join("Programs")
+ .join("Git")
+ .join("bin")
+ .join("bash.exe");
+ if bash_path.exists() {
+ return Some(bash_path);
+ }
+ }
+
None
}