From e373348ea6cc1e73e3e8b64070e72c82149a183b Mon Sep 17 00:00:00 2001 From: ronalds Date: Tue, 25 Nov 2025 21:17:43 -0300 Subject: [PATCH] Se Agrego SCript para automatizar Git --- gitUpdate.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 gitUpdate.ps1 diff --git a/gitUpdate.ps1 b/gitUpdate.ps1 new file mode 100644 index 0000000..de3a6d1 --- /dev/null +++ b/gitUpdate.ps1 @@ -0,0 +1,26 @@ +Clear-Host + +# Pedir mensaje de commit +$mensaje = Read-Host "Ingrese el mensaje de commit" + +Write-Host "Agregando archivos..." +git add . + +Write-Host "Creando commit..." +git commit -m "$mensaje" + +Write-Host "Haciendo push a la rama develop..." +$pushOutput = git push origin develop 2>&1 + +# Revisar si fallo la autenticacion +if ($pushOutput -match "Authentication failed" -or $pushOutput -match "Failed to authenticate") { + Write-Host "`nERROR: Fallo la autenticacion. Ejecutando git init para reconfigurar..." -ForegroundColor Red + + git init + + Write-Host "Intentando push nuevamente..." + git push origin develop +} + +Write-Host "`nProceso finalizado." +pause