Skip to content

Instantly share code, notes, and snippets.

@itroyano
Created February 20, 2025 15:10
Show Gist options
  • Select an option

  • Save itroyano/a31dafdb3654470e89671b73a958cf64 to your computer and use it in GitHub Desktop.

Select an option

Save itroyano/a31dafdb3654470e89671b73a958cf64 to your computer and use it in GitHub Desktop.
syncLocalRepos.sh
GH_USER=itroyano
find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | cut -c 2- | xargs -I {} gh repo sync $GH_USER{} -b main
find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | xargs -I {} git -C {} pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment