#!/bin/bash set -euo pipefail REPO_DIR="$HOME/Desktop/AI_Healer_Files" LOG_DIR="$REPO_DIR/healer_logs" cd "$REPO_DIR" # Checkout (or create) logs branch git fetch origin logs || true git checkout logs || git checkout -b logs # Copy logs into this branch mkdir -p healer_logs cp -r "$LOG_DIR"/*.log healer_logs/ 2>/dev/null || true git add healer_logs/*.log || true if ! git diff --cached --quiet; then git commit -m "🩹 Auto-push healer logs $(date)" git push origin logs || true echo "✅ Logs pushed to GitHub (logs branch). Cleaning local copies..." rm -f "$LOG_DIR"/*.log else echo "⚠️ No new logs to push." fi # Switch back to main branch git checkout main