Execute o comando git em vários repositórios

Salve este script na pasta onde você guarda seus repositórios git_all_repos, torne-o executável e aproveite.

Uso: git_all_repos pull

#!/bin/bash

shift $
(($OPTIND - 1))

# Replace manually specified repos with this to run script on all directories
#
#PWD=`pwd`
#DIRS=`ls -l $PWD | egrep '^d' | awk '{print $9}'`


# Specify on which repos run script
#
declare
-a DIRS=(admin-portal admin-portal-api client-manager client-manager-api commons product-ingest product-ingest-api product-ingest-worker product-manager search-client search-manager search-manager-api store-presentation)


for DIR in ${DIRS[@]}
do

#Execute command
#
OUT
=`cd $DIR && git ${*}`

#Pretty print
#
echo
-e ""
echo
-e "executing in: $DIR"
echo $OUT

echo
"-------------------------------"

done