-
-
Save ollynevard/5269354 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 | |
# Store the current directory | |
current_directory=$(pwd) | |
# Setup colours | |
c_reset='\033[00m' | |
c_highlight='\033[33m' | |
echo -e "\n${c_highlight}Pulling in latest changes for all repositories...${c_reset}" | |
# Find all git repositories | |
for i in $(find . -name ".git" | cut -c 3-); do | |
# Change the repository directory. | |
cd "$i/.."; | |
echo -e "\n${c_highlight}${PWD##*/}${c_reset}"; | |
# Update repository. | |
git pull origin; | |
# Back to current directory. | |
cd $current_directory | |
done | |
echo -e "\n${c_highlight}Complete!${c_reset}\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment