Skip to content

Instantly share code, notes, and snippets.

@lsjroberts
Last active December 23, 2015 04:18
Show Gist options
  • Save lsjroberts/6578825 to your computer and use it in GitHub Desktop.
Save lsjroberts/6578825 to your computer and use it in GitHub Desktop.
Git directory commands
clear
dir=$(pwd)
for i in `find $dir -type d -maxdepth 1`; do
if [ $i != $dir ]
then
echo "\n\033[33mChecking $i\033[0m"
cd $i
git branch -v --no-abbrev | grep '*'
cd ../
fi
done
clear
dir=$(pwd)
for i in `find $dir -type d -maxdepth 1`; do
if [ $i != $dir ]
then
echo "\n\033[33mChecking $i\033[0m"
cd $i
git checkout develop
cd ../
fi
done
clear
dir=$(pwd)
for i in `find $dir -type d -maxdepth 1`; do
if [ $i != $dir ]
then
echo "\n\033[33mChecking $i\033[0m"
cd $i
git checkout master
cd ../
fi
done
clear
dir=$(pwd)
for i in `find $dir -type d -maxdepth 1`; do
if [ $i != $dir ]
then
echo "\n\033[33mChecking $i\033[0m"
cd $i
git pull
cd ../
fi
done
clear
dir=$(pwd)
for i in `find $dir -type d -maxdepth 1`; do
if [ $i != $dir ]
then
echo "\n\033[33mChecking $i\033[0m"
cd $i
git branch -v --no-abbrev
cd ../
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment