Skip to content

Instantly share code, notes, and snippets.

@minus34
Last active March 24, 2021 06:28
Show Gist options
  • Save minus34/f20791ce979956ebb8ddbaf005538f8e to your computer and use it in GitHub Desktop.
Save minus34/f20791ce979956ebb8ddbaf005538f8e to your computer and use it in GitHub Desktop.
Update all GitHub repositories and checkout master branches
#!/usr/bin/env bash
cd ~/git/minus34
for d in */ ; do
echo "################################"
echo "# $d #"
echo "################################"
cd ./$d
git checkout master
git checkout main # lazy way of covering both
git fetch --all
git merge
cd ..
done
cd ~/git/iag_geo
for d in */ ; do
echo "################################"
echo "# $d #"
echo "################################"
cd ./$d
git checkout master
git checkout main # lazy way of covering both
git fetch --all
git merge
cd ..
done
cd ~/git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment