# 1. Go to your repository
cd /home/innodlnf/innotique_final || exit

# 2. Stash any local changes (optional, safe)
git stash -u

# 3. Pull latest changes from Git
git pull origin main

# 4. Apply previously stashed changes back (if any)
git stash pop || true

# 5. Sync public/ folder to public_html/ but ignore index.php and .env
rsync -av --exclude='index.php' --exclude='.env' --delete public/ 
../public_html/

# 6. Done
echo "Update complete."

