Last active
October 22, 2017 16:57
-
-
Save oxcar103/697520c3db16613f9b12 to your computer and use it in GitHub Desktop.
Script to update a group of repositories of GitHub
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 | |
# Para corregir errores con los directorios que contengan espacios: | |
SAVEIFS=$IFS | |
IFS=$(echo -en "\n\b") | |
a=$PWD | |
# A partir del directorio actual, buscamos los directorios con la carpeta oculta ".git" | |
# y le quitamos el primer y último campo ya que serán "." y ".git", respectivamente. | |
for b in $(find ./ -name ".git" | cut -d/ -f 2- | rev | cut -d/ -f 2- | rev); | |
do | |
echo $b":" | |
cd ./$b | |
git pull | |
cd $a | |
done; | |
# Restauramos el valor modificado | |
IFS=$SAVEIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment