Created
April 8, 2026 13:17
-
-
Save newmen/f2006c5562b6dda6ad236ad974b566f2 to your computer and use it in GitHub Desktop.
update all repos in the current director
This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -e | |
| ROOT_DIR="${1:-.}" | |
| find "$ROOT_DIR" -type d -name ".git" | while read -r gitdir; do | |
| repo_dir="$(dirname "$gitdir")" | |
| echo "=== Updating $repo_dir ===" | |
| ( | |
| cd "$repo_dir" || exit | |
| git checkout master | |
| git pull origin master | |
| ) | |
| done | |
| echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment