Skip to content

Instantly share code, notes, and snippets.

@himito
Last active August 18, 2020 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himito/4a4d1160fa098361ed2768f423c348cf to your computer and use it in GitHub Desktop.
Save himito/4a4d1160fa098361ed2768f423c348cf to your computer and use it in GitHub Desktop.
Script to pull all the git repository in a folder
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
printf "\nPulling in latest changes for all repositories...\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" -type d); do
printf "\n$i";
# We have to go to the .git parent directory to call the pull command
git --git-dir "$i" fetch -q --all
done
printf "\n\nComplete!\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment