diff --git a/public/git-pull.php b/public/git-pull.php index 56127f2f8..797664323 100644 --- a/public/git-pull.php +++ b/public/git-pull.php @@ -138,8 +138,9 @@ if (file_exists('public/optimize.php')) { execute("git reset --hard HEAD 2>&1"); execute("git clean -fd 2>&1"); // Force clean untracked files and directories -// 2. Pull latest changes -execute("git pull origin main 2>&1"); +// 2. Pull latest changes (fetch & hard reset to origin/main to handle force pushes cleanly) +execute("git fetch origin main 2>&1"); +execute("git reset --hard origin/main 2>&1"); // 4. Re-optimize Laravel cache and run migrations $phpBin = PHP_BINARY;