Skip to content

Instantly share code, notes, and snippets.

@weilueluo
Created November 22, 2022 13:50
Show Gist options
  • Save weilueluo/86eccabbb009867fc8c2195153bc0e7d to your computer and use it in GitHub Desktop.
Save weilueluo/86eccabbb009867fc8c2195153bc0e7d to your computer and use it in GitHub Desktop.
for every repo in the current directory, checkout master, reset --hard and pull
find . -mindepth 1 -maxdepth 1 -type d -print | xargs -I {} bash -c 'git -C {} rev-parse --is-inside-work-tree &> /dev/null && echo {} && git -C {} checkout master && git -C {} reset --hard && git -C {} pull'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment