You could use this shell script to manage multiple git repos.
you could run git clone https://github.com/robbenz/gitme.git
to have a look. I will post it below as well.
open the script in your text editor, and enter in the file paths of your different git projects.
I saved an alias
in my ~/.bash_profile
called gitme
to run this script and then you can run a git status
or git push
or git pull
on all of your git projects at once. projects can be comited with either a unique or generic commit message
#!/bin/bash -e
# enter in your different git projects
REPOS=(
/Users/you/repo1
/Users/you/repo2
/Users/you/repo3
/Users/you/repo4
)
MOVE="Moving to next REPO... \n"
tput setaf 2;echo "What do ya wanna do? You can say push, pull, commit, ftp push, or status"; tput sgr0
read input
if [ $input = "commit" ]
then
tput setaf 2;echo "Do you want a unique commit message? [y/n]";tput sgr0
read ans
if [ $ans = "y" ]
then
for i in "${REPOS[@]}"
do
cd "$i"
tput setaf 6;pwd;tput sgr0
git add . -A
read -p "Commit description: " desc
git commit -m "$desc"
tput setaf 2;echo $MOVE;tput sgr0
sleep 1
done
else
for i in "${REPOS[@]}"
do
cd "$i"
tput setaf 6;pwd;tput sgr0
git add . -A
git commit -m "autocommit backup point"
tput setaf 2;echo $MOVE;tput sgr0
sleep 1
done
fi
elif [ $input = "push" ] || [ $input = "pull" ] || [ $input = "ftp push" ] || [ $input = "status" ]
then
for i in "${REPOS[@]}"
do
cd "$i"
tput setaf 6;pwd;tput sgr0
git $input
tput setaf 2;echo $MOVE;tput sgr0
sleep 1
done
else tput setaf 1;echo "Sorry, thats not on the list";tput sgr0
fi