Skip to content

Instantly share code, notes, and snippets.

@Calinou
Last active July 8, 2023 23:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Calinou/93938dc92484bc5e89f0 to your computer and use it in GitHub Desktop.
Save Calinou/93938dc92484bc5e89f0 to your computer and use it in GitHub Desktop.
Updates all Git repositories in a directory
#!/bin/bash
# Copyright (c) 2015 Calinou
# CC0 1.0 Universal
# <https://creativecommons.org/publicdomain/zero/1.0/>
update() {
for d in "$@"; do
test -d "$d" -a \! -L "$d" || continue
cd "$d"
if [ -d ".git" ]; then
echo -e "\e[1;36m$PWD\e[0m"
git pull
fi
cd ..
done
}
update *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment