From 870ebb885022ead3a2f9f2008de4380df7a0e73b Mon Sep 17 00:00:00 2001 From: Test Date: Fri, 20 Mar 2026 22:25:17 -0700 Subject: [PATCH] fix: use git pull --ff-only in update/install to avoid divergent branch error Fresh installs without pull.rebase configured hit a git error when running hermes update because git doesn't know how to reconcile divergent branches. --ff-only is the right strategy: it works for the normal case (local branch is behind remote) and fails cleanly if the user somehow has local commits, rather than silently rebasing them. --- hermes_cli/main.py | 2 +- scripts/install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 33d3a0601..dfd8bd419 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -2688,7 +2688,7 @@ def cmd_update(args): print("→ Pulling updates...") try: - subprocess.run(git_cmd + ["pull", "origin", branch], cwd=PROJECT_ROOT, check=True) + subprocess.run(git_cmd + ["pull", "--ff-only", "origin", branch], cwd=PROJECT_ROOT, check=True) finally: if auto_stash_ref is not None: _restore_stashed_changes( diff --git a/scripts/install.sh b/scripts/install.sh index c2ec21834..d4edf2e11 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -577,7 +577,7 @@ clone_repo() { git fetch origin git checkout "$BRANCH" - git pull origin "$BRANCH" + git pull --ff-only origin "$BRANCH" if [ -n "$autostash_ref" ]; then local restore_now="yes"