mirror of
https://github.com/DeNNiiInc/Web-Page-Performance-Test.git
synced 2026-04-19 12:35:59 +00:00
Update auto-sync scripts to use git reset --hard
This commit is contained in:
@@ -36,9 +36,9 @@ fi
|
|||||||
|
|
||||||
log "🔄 Changes detected! Local: ${LOCAL:0:7} -> Remote: ${REMOTE:0:7}"
|
log "🔄 Changes detected! Local: ${LOCAL:0:7} -> Remote: ${REMOTE:0:7}"
|
||||||
|
|
||||||
# Pull changes
|
# Force update
|
||||||
if ! git pull origin main; then
|
if ! git reset --hard origin/main; then
|
||||||
log "❌ Error: Git pull failed"
|
log "❌ Error: Git reset failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ fi
|
|||||||
|
|
||||||
log "🔄 Changes detected! Pulling updates..."
|
log "🔄 Changes detected! Pulling updates..."
|
||||||
|
|
||||||
# Pull changes
|
# Force update (overwrite local changes)
|
||||||
git pull origin main 2>&1 | tee -a "$LOG_FILE"
|
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
|
# Install/update dependencies if package.json changed
|
||||||
if git diff --name-only $LOCAL $REMOTE | grep -q "package.json"; then
|
if git diff --name-only $LOCAL $REMOTE | grep -q "package.json"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user