Last active
July 27, 2021 16:42
-
-
Save fitorec/588cfde4bcb9df77c6f2d58aaa0acb66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Se encarga de actualizar un determinado repositorio | |
# .---. | |
# / \ | |
# \.@-@./ | |
# /`\_/`\ | |
# // _ \\ | |
# | \ )|_ | |
# /`\_`> <_/ \ | |
#___\__/'---'\__/_______________________________________________________ | |
# ====================================================================== | |
# | |
# Como usar: | |
# 0- mover escript en: /bin/update_some_project | |
# 1- darle permisos de ejecución: chmod +x /bin/update_some_project (o crear un link simbólico es otra opción) | |
# 2- Ejecutar en el crontab como `update_some_project` (o como le hayas llamado) | |
# | |
# Mayor información consultar el siguiente enlace: | |
# https://git-scm.com/book/es/v2/Ramificaciones-en-Git-Reorganizar-el-Trabajo-Realizado | |
repoPath='/opt/updateSomeProject/' | |
echo -e "\nActualizando repo\n" | |
echo "****** actualizando directorio " ${repoPath} "******" | |
cd "${repoPath}" | |
git status | |
echo "Fetching" | |
git fetch | |
echo "Pulling" | |
git pull --rebase | |
echo "******************************************" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment