fix: force git pull in gitapply.sh to handle overwrites

This commit is contained in:
2026-01-25 12:16:29 -05:00
parent e322c0cda7
commit e977787904

View File

@@ -244,7 +244,7 @@ run_remote_update() {
echo "pending" > "$status_file"
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o BatchMode=yes -i "$SSH_KEY" root@"$node" \
'cd /var/www/paymenter && git pull && npm update && npm upgrade && composer upgrade && php artisan view:clear && php artisan cache:clear && php artisan optimize && while ! systemctl restart php8.3-fpm 2>/dev/null; do echo "PHP-FPM restart failed, running optimize and retrying..."; php artisan optimize; sleep 1; done' \
'cd /var/www/paymenter && git fetch --all && git reset --hard origin/main && npm update && npm upgrade && composer upgrade && php artisan view:clear && php artisan cache:clear && php artisan optimize && while ! systemctl restart php8.3-fpm 2>/dev/null; do echo "PHP-FPM restart failed, running optimize and retrying..."; php artisan optimize; sleep 1; done' \
> "$STATUS_DIR/${node}.log" 2>&1
if [ $? -eq 0 ]; then
@@ -485,7 +485,7 @@ print_node_grid "Initial Cluster Status" "false" "${REMOTE_NODES[@]}"
# Local Git Pull
task_start "Local: Pulling Latest Changes"
printf " ${C3}○${NC} Fetching from remote..."
git pull > /tmp/git_output.txt 2>&1 &
git fetch --all > /tmp/git_output.txt 2>&1 && git reset --hard origin/main >> /tmp/git_output.txt 2>&1 &
wave_spinner $! "Fetching from remote..."
GIT_STATUS=$?