From 039e126d9a26470b64568df2017c704796b927b4 Mon Sep 17 00:00:00 2001 From: DeNNiiInc Date: Sun, 28 Dec 2025 10:17:18 +1100 Subject: [PATCH] Update auto-sync scripts to use git reset --hard --- auto-sync-robust.sh | 6 +++--- auto-sync.sh | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/auto-sync-robust.sh b/auto-sync-robust.sh index 2ce52f8..532ee38 100644 --- a/auto-sync-robust.sh +++ b/auto-sync-robust.sh @@ -36,9 +36,9 @@ fi log "🔄 Changes detected! Local: ${LOCAL:0:7} -> Remote: ${REMOTE:0:7}" -# Pull changes -if ! git pull origin main; then - log "❌ Error: Git pull failed" +# Force update +if ! git reset --hard origin/main; then + log "❌ Error: Git reset failed" exit 1 fi diff --git a/auto-sync.sh b/auto-sync.sh index 8c96648..520b602 100644 --- a/auto-sync.sh +++ b/auto-sync.sh @@ -39,8 +39,9 @@ fi log "🔄 Changes detected! Pulling updates..." -# Pull changes -git pull origin main 2>&1 | tee -a "$LOG_FILE" +# Force update (overwrite local changes) +log "⚠️ Resetting local changes to match remote..." +git reset --hard origin/main 2>&1 | tee -a "$LOG_FILE" # Install/update dependencies if package.json changed if git diff --name-only $LOCAL $REMOTE | grep -q "package.json"; then