Created
April 11, 2018 06:49
-
-
Save iszlai/14f8e809f4c540e999a156b073222adc to your computer and use it in GitHub Desktop.
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 | |
#Define the color yellow for later use | |
YELLOW='\033[0;33m' | |
#Define text reset | |
NC='\033[0m' | |
pathToRepos=~/work/repos | |
for i in `ls $pathToRepos`;do | |
repo=$pathToRepos"/"$i | |
#Get curreny branch name | |
branch=`git -C $repo symbolic-ref --short -q HEAD` | |
if [ -d $repo/.git ]; then | |
echo -e "\n${YELLOW}#"$i"#${NC} - ${branch}\n" | |
git -C $repo stash | |
git -C $repo pull --rebase | |
git -C $repo stash pop | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment