Se Agrego SCript para automatizar Git
This commit is contained in:
26
gitUpdate.ps1
Normal file
26
gitUpdate.ps1
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user