Skip to content

Instantly share code, notes, and snippets.

@fitorec
Last active July 27, 2021 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitorec/588cfde4bcb9df77c6f2d58aaa0acb66 to your computer and use it in GitHub Desktop.
Save fitorec/588cfde4bcb9df77c6f2d58aaa0acb66 to your computer and use it in GitHub Desktop.
#!/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