Comit inicial
This commit is contained in:
44
gitea_push.sh
Executable file
44
gitea_push.sh
Executable file
@ -0,0 +1,44 @@
|
||||
#!/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
|
Reference in New Issue
Block a user