These are helpful commands to use for the Hestia server where you may have a Laravel API working with a React SPA and you need to push and pull the new changes to the laravel application in the remote server using ssh:

PUSH from LOCAL

To push from local dev:

git add .
git commit -m "202404271821pm. Fixed the issues with the time differences in server and posts"
git push production main

 

TO PULL/FETCH FROM REMOTE SERVER

#REMOTE SERVER PULL:
TRY THIS BEFORE YOU REBUILD: THIS WORKS
https://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files
cd ~/web/[SITE].com/private/laravel/[APPNAME]
git add *
git commit -m "202404271821pm. example commit"
git fetch production main
git merge -s recursive -X theirs production/main
php artisan config:cache
php artisan config:clear
php artisan cache:clear
php artisan route:cache