From 437c525fbdc94bf2f5ddf16965efb9a83f73a50a Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Fri, 5 Jun 2026 19:24:48 -0400 Subject: [PATCH] git pull: replace reset --hard + clean -fd with --ff-only --- git_pull_execute.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/git_pull_execute.sh b/git_pull_execute.sh index 652aba2..b8464e7 100755 --- a/git_pull_execute.sh +++ b/git_pull_execute.sh @@ -208,19 +208,15 @@ else # Uses conf files already present from last pull to determine exclusions configure_sparse_checkout "$TARGET_DIR" - log "git reset --hard" - git reset --hard - - log "git clean -fd" - git clean -fd - echo " Pulling latest changes..." - if GIT_SSH_COMMAND="ssh -i $GITEA_SSH_KEY -p $SSH_PORT" git pull; then + if GIT_SSH_COMMAND="ssh -i $GITEA_SSH_KEY -p $SSH_PORT" git pull --ff-only; then echo " Git pull successful" SYNC_SUCCESS=true else - error "Git pull failed" - notify "Git pull failed on $(hostname) — check Gitea connectivity" "Git Sync" "alert" + # ff-only fails when local commits or tracked changes exist that can't + # fast-forward. Fail loudly — never silently destroy local work. + error "Git pull failed — local changes conflict with remote (will not force-reset)" + notify "Git pull failed on $(hostname) — local changes conflict, manual resolve needed" "Git Sync" "alert" exit 1 fi