#!/bin/bash echo "📁 Ingresá el directorio del proyecto:" read -r PROJECT_DIR if [ ! -d "$PROJECT_DIR" ]; then echo "❌ El directorio no existe. Abortando." exit 1 fi cd "$PROJECT_DIR" || exit # Inicializar Git si no existe if [ ! -d ".git" ]; then echo "🔧 Inicializando repositorio Git local..." git init git branch -m main fi # Agregar archivos git add . echo "📝 Ingresá el mensaje del commit:" read -r COMMIT_MSG git commit -m "$COMMIT_MSG" # Configurar remoto echo "🌐 Ingresá la URL del repositorio remoto en Gitea (HTTPS):" read -r REMOTE_URL git remote remove origin 2>/dev/null git remote add origin "$REMOTE_URL" # Autenticación echo "🔐 Ingresá tu usuario de Gitea:" read -r USER echo "🔐 Ingresá tu contraseña o token de Gitea:" read -rs PASS # Push echo "🚀 Subiendo archivos..." git push -u https://"$USER":"$PASS"@"${REMOTE_URL#https://}" main