Last active
March 23, 2022 14:55
-
-
Save aldegoeij/f5a375810ec7fffe0b083f2002f5ce6f to your computer and use it in GitHub Desktop.
Sync an entire GitHub org using `gh`. It clones missing repo's first, then runs a pull. Pull might fail if you have changes in your tree.
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
gh repo list $ORG_NAME_HERE --limit 1000 | while read -r repo _; do | |
gh repo clone "$repo" "$repo" -- | |
git -C "$repo" pull | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
removed the
--depth=1
because a shallow clone of a repo is a pain to unshallow and continue working on remote branches.