fix(deploy): use git fetch and git reset --hard origin/main in deployment script
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user